define(".", [ "static_v4/style/style.css", "static_v4/style/index_v6.css", "static_v4/style/quanpei.css", "static_v4/js/minJS/commonPlug/commonPlug.min", "static_v4/js/plug/swiper/swiper.min", "static_v4/js/plug/jroll/jroll.min", "static_v4/js/mod/swiperAds", "static_v4/js/mod/visualAreaInfo", "static_v4/js/mod/historyCookie", "static_v4/js/mod/public", "static_v4/js/plug/base64", "static_v4/js/mod/webcall_message", "static_v4/js/mod/addcar_quick", "static_v4/js/mod/adsModel", "static_v4/js/mod/areaList", "static_v4/js/mod/index_v6_sea" ], function(require, exports, module) {
    // require("static_v4/style/MobReset.css");
    require("static_v4/style/style.css");
    require("static_v4/style/index_v6.css");
    require("static_v4/style/quanpei.css");
    require("static_v4/js/minJS/commonPlug/commonPlug.min");
    require("static_v4/js/plug/swiper/swiper.min");
    require("static_v4/js/plug/jroll/jroll.min");
    require("static_v4/js/mod/swiperAds");
    require("static_v4/js/mod/historyCookie");
    require("static_v4/js/mod/webcall_message");
    require("static_v4/js/mod/addcar_quick");
    require("static_v4/js/mod/adsModel");
    require("static_v4/js/mod/areaList");
    var OIndexSea = require("static_v4/js/mod/index_v6_sea");
    module.exports = {
        init: function(data, name) {
            OIndexSea.init(data, name);
        }
    };
    require.async([ "static_v4/js/mod/baiduCount", // 获取可视区域a元素
    "static_v4/js/mod/visualAreaInfo" ]);
});
define("static_v4/js/mod/index_v6_sea", [ "./public", "./adsModel", "./visualAreaInfo", "./areaList" ], function(require, exports, module) {
    var myPub = require("./public");
    // 广告模块
    var myAdsModel = require("./adsModel");
    // 地区管
    var areaList = require("./areaList");
    // 曝光可视区域元素
    var visualArea = require("./visualAreaInfo");
    var oWindow = $(window);
    var oWrap = $(".js_wrap");
    // wrap 部分
    var oHeader = $(".js_headerBox");
    // 头部
    var oFooter = $(".js_footer");
    // 底部
    var oSearchBox = $(".js_searchBox");
    // 搜索
    var oContain = $(".js_contain");
    // 页面内容区域
    var oSlidePageWrap = $(".js_slidePageWrap");
    // 滑动页面
    var oSlidePage = $(".js_slidePage");
    // 滑动页面容器
    var oSideBox = $(".js_sideBox");
    // 侧边按钮框
    var oGoTop = $(".js_goTop");
    // 回到顶部
    var popCloseBtn = $(".js_layer_AdsCloseBtn");
    // 弹窗关闭按钮
    var oLoadingPage = $(".js_loadingPage");
    var oSildeNav = $(".js_sildeNav ");
    // 导航栏
    var oSildeNavScroll = $(".js_sildeNavScroll");
    // 导航滚动条容器
    var oSildeNavUl = $(".js_sildeNavUl");
    // 导航滚动条ul
    var oSlidePageScroll = $(".js_slidePageScroll");
    var oSildeNavJRoll = new myPub.ScrollBar();
    // 导航滚动条
    var nDisScrollLi = 0;
    // 导航滚动偏移值
    var oGoods_showTwo = $(".js_goods_showTwo");
    // 并排产品容器
    var oAIEntrance = $(".js_voiceEntrance");
    //智能语音入口
    var oSlideDown = $(".js_slideDown");
    //点击下拉弹窗按钮
    var oSlideUp = $(".js_slideUp");
    //点击上拉弹窗按钮
    var oNewNavPop = $(".js_newSlideNavPop");
    //新导航弹窗
    var oPackUpBox = $(".js_packUpBox");
    //弹窗的
    var oCloseShawdow = $(".js_closeSlideNav");
    //剩下的阴影
    var lazLoading = new myPub.lazLoadingImg();
    var timeOutClock = null;
    //返现专区跳转的定时器
    var perLimit = 20;
    var resizeTimer = null;
    var counponNewData = JSON.parse(sessionStorage.getItem("judgeNew_friend_coupons"));
    // 获取新人用户的优惠券数据
    var nNewFriend = "";
    // 判断是不是新用户
    nNewFriend = sessionStorage.getItem("judgeNew_friend");
    // 新用户session的值
    $(".guideShow").on("touchmove", function(e) {
        e.preventDefault();
    });
    oHeader.on("touchmove", function(e) {
        e.preventDefault();
    });
    oFooter.on("touchmove", function(e) {
        e.preventDefault();
    });
    // 回到过顶部
    oGoTop.hammer().on("tap", function() {
        oSlidePageScroll.eq(ajaxData.navIndex).stop().animate({
            scrollTop: "0"
        }, 250);
        oHeader.css({
            top: 0
        }).find(".js_sildeNav").removeClass("active");
        myPub.HamstopPropaga();
    });
    // 关闭广告
    popCloseBtn.on("click", function(e) {
        $(".layer_Ads_index").hide();
        e.stopPropagation();
    });
    oSlideDown.hammer().on("tap", function() {
        oNewNavPop.show();
    });
    oSlideUp.hammer().on("tap", function() {
        oNewNavPop.hide();
    });
    var categoryData, categoryNames;
    module.exports = {
        init: function(data, names) {
            categoryData = data;
            categoryNames = names;
            // 显不显示智能语音接口
            sfddjIndex.showAIEntrance();
            // 生成新的滑动页面html
            sfddjIndex.AppendSlidePage(names);
            // 重新定义
            oSlidePageScroll = $(".js_slidePageScroll");
            // 初始化左右滑动swiper
            sfddjIndex.SwiperSlide(names);
            // 初始化页面代码
            sfddjIndex.sfddjInit(true);
            // 历史记录初始化
            ajaxData.HistoryInit();
            // ajax请求前 锁定
            ajaxData.lockScroll();
            // 加载地区馆
            if (oSlidePageScroll.eq(ajaxData.navIndex).hasClass("areaListBox")) {
                areaList.AreaListShow(function() {
                    // oLoadingPage.hide();
                    ajaxData.unlockScroll();
                    ajaxData.tabLoadOff[ajaxData.navIndex] = false;
                    ajaxData.SetSession();
                });
            } else {
                // 请求加载广告模块
                myAdsModel.adsAjax.AdsAjaxData(ajaxData.navIndex, categoryNames, function() {
                    // 请求加载产品
                    // ajax请求前 锁定
                    // ajaxData.lockScroll();
                    ajaxData.GoodsAjaxData(ajaxData.navIndex, true, function() {
                        // ajax请求前 锁定
                        ajaxData.unlockScroll();
                    });
                });
            }
            // 设置页面滚动事件
            sfddjIndex.ScrollPage();
            // 倒计时
            myAdsModel.adsInit.CutDataTime();
            // 检测需不需要弹出新人优惠券
            if (nNewFriend == "newFriend") {
                // 弹出优惠券弹窗
                connectHtml.newFriendHtml();
            } else {
                // 获取弹窗
                myAdsModel.adsAjax.getPop();
            }
            // 产品懒加载  异步加载 调用这个
            lazLoading.AddLazLoadingImg(oSlidePageScroll[ajaxData.navIndex]);
            // 页面尺寸修改
            oWindow.on("resize", function() {
                if (resizeTimer) {
                    clearTimeout(resizeTimer);
                }
                resizeTimer = setTimeout(function() {
                    sfddjIndex.sfddjInit(true);
                }, 400);
            });
            // 页面跳转记录数据
            oWindow.unload(function() {
                ajaxData.SetSession();
            });
        }
    };
    var sfddjIndex = {
        // 页面swiper
        oSlidePageMain: "",
        nHeaderHeight: 0,
        nSearchBoxHeight: 0,
        nSildeNavHeight: 0,
        time_Scroll: null,
        // 滚动计时器
        // 调整页面位置和初始化
        sfddjInit: function(bOff) {
            // bOff true 执行下面方法
            if (bOff) {
                sfddjIndex.SetSildeNavScroll();
                oContain.css({
                    "padding-top": 0,
                    "padding-bottom": 0
                });
                oSlidePageScroll.css({
                    height: oWindow.height() - oHeader.height() - oFooter.height(),
                    "padding-top": oHeader.outerHeight(true),
                    "padding-bottom": oFooter.outerHeight(true)
                });
                myPub.SetImgHeight(oGoods_showTwo);
                sfddjIndex.slideNavPop();
            }
            oHeader.css({
                top: 0
            }).find(".js_sildeNav").removeClass("active");
            oSideBox.stop().animate({
                right: "-3.5rem"
            }, 300);
        },
        // 插入slide
        AppendSlidePage: function(name, fn) {
            var _className = "";
            var _advMainHtml = '<div class="AdvertMain jsAdvert"></div>';
            for (var i = 0; i < name.length; i++) {
                if (name[i].replace(/\s/g, "") == "地区馆") {
                    _className = "areaListBox";
                    _advMainHtml = '<div class="areaList js_areaList"></div>';
                }
                if (name[i].replace(/\s/g, "") == "返现专区") {
                    _className = "memberCashBack";
                    _advMainHtml = '<div class="memberCashBackSon js_memberCashBack Height100"></div>';
                }
                oSlidePageWrap.append('<div class="swiper-slide js_slidePageScroll ' + _className + '"><div class="slidePageMain js_slidePageMain">' + _advMainHtml + "</div></div>");
                ajaxData.pagearr.push(1);
                ajaxData.tabLoadOff.push(true);
                ajaxData.pageSCroll.push(0);
                ajaxData.loadFinish.push(false);
                ajaxData.dataStore[i + 1] = [];
                ajaxData.dataStore_Off.push(true);
            }
            if (fn) fn();
        },
        // 初始加载滑动页面和添加导航信息
        SwiperSlide: function(data) {
            var _this = this;
            _this.oSlidePageMain = oSlidePage.swiper({
                pagination: oSildeNavUl[0],
                observe: true,
                observeParents: true,
                // onlyExternal: true,
                //threshold:50,
                touchAngle: 20,
                paginationClickable: true,
                paginationBulletRender: function(index, className) {
                    //添加导航
                    index == 0 ? names = "推荐" : names = data[index - 1].replace(/\s/g, "");
                    return '<li class="' + className + '"><a>' + names + "</a></li>";
                },
                onSlideChangeStart: function(swiper) {
                    var index = swiper.activeIndex;
                    if (ajaxData.tabLoadOff[index]) {
                        oLoadingPage.show();
                    }
                    // _this.oSlidePageMain.destroy(false);
                    _this.oSlidePageMain.detachEvents();
                },
                // 滑动结束
                onSlideChangeEnd: function(swiper) {
                    var index = swiper.activeIndex;
                    ajaxData.navIndex = index;
                    ajaxData.lockScroll();
                    // 初始化页面 false 说明滚动不需要重置
                    sfddjIndex.sfddjInit(false);
                    // 同步滚动导航和页面滑动
                    _this.SildeNavScrollDis(index);
                    oSlidePageScroll.find(".js_slidePageMain").hide().eq(index).show();
                    //同步导航弹窗的选中内容
                    oNewNavPop.find(".js_newSlideNavLi").removeClass("active").eq(index).addClass("active");
                    lazLoading.DestroyLazLoadingImg();
                    lazLoading.AddLazLoadingImg(oSlidePageScroll[index]);
                    if (ajaxData.tabLoadOff[index]) {
                        // 地区馆添加
                        if (oSlidePageScroll.eq(index).hasClass("areaListBox")) {
                            areaList.AreaListShow(function() {
                                // oLoadingPage.hide();
                                ajaxData.tabLoadOff[index] = false;
                                ajaxData.unlockScroll();
                                ajaxData.SetSession();
                            });
                        } else if (oSlidePageScroll.eq(index).hasClass("memberCashBack")) {
                            myPub.locationHref("https://m.sfddj.com/returnCash/index");
                            ajaxData.unlockScroll();
                            sfddjIndex.oSlidePageMain.slideTo(0, 100);
                        } else {
                            myAdsModel.adsAjax.AdsAjaxData(index, categoryNames, function() {
                                ajaxData.GoodsAjaxData(index, true, function() {
                                    ajaxData.unlockScroll();
                                    ajaxData.tabLoadOff[index] = false;
                                    ajaxData.SetSession();
                                });
                            });
                        }
                    } else {
                        ajaxData.unlockScroll();
                        ajaxData.tabLoadOff[index] = false;
                        ajaxData.SetSession();
                    }
                    _this.oSlidePageMain.attachEvents();
                }
            });
            //设置导航弹窗里的标题栏高度
            _this.slideNavPop();
        },
        //初始化导航弹窗内容
        slideNavInit: function() {
            var _this = this;
            //给导航弹窗加入内容
            oNewNavPop.find(".js_slideNavUl").append(connectHtml.slideNavHtml(categoryNames));
            // 初始化方法
            oNewNavPop.on("click", function(e) {
                e.preventDefault();
                var _tarTag = e.target;
                var $target;
                _tarTag.nodeName.toLowerCase() == "li" ? $target = $(_tarTag) : $target = $(_tarTag).parents("li");
                if ($target.hasClass("js_newSlideNavLi")) {
                    var index = $target.attr("slideIndex");
                    oNewNavPop.find(".js_newSlideNavLi").removeClass("active");
                    $target.addClass("active");
                    sfddjIndex.oSlidePageMain.slideTo(index, 100);
                    oNewNavPop.hide();
                }
                //如果点击剩下的遮罩层隐藏弹窗
                if ($target.hasClass("js_closeSlideNav")) {
                    oNewNavPop.hide();
                }
            });
        },
        //初始化新加的导航弹窗
        slideNavPop: function() {
            var _this = this;
            //获取导航栏的高度
            var navH = oSildeNav.outerHeight(true);
            //先设置字体白色，因为刚打开其他没内容时会比较难看，导航加载完现在设置正常字体颜色
            $(".js_slideDown").find(".iconGoDown").css({
                color: "#323232"
            });
            oPackUpBox.css({
                height: navH
            });
        },
        // 设置导航宽度和滚动
        SetSildeNavScroll: function() {
            var sumLiWidth = 0;
            var oSildNavLi = oSildeNavUl.find("li");
            oSildNavLi.each(function(i) {
                sumLiWidth += oSildNavLi.eq(i).outerWidth(true) + .5;
            });
            oSildeNavUl.css({
                width: Math.ceil(sumLiWidth)
            });
            nDisScrollLi = parseInt((oSildeNavScroll.width() - oSildeNavUl.outerWidth(true)) / (oSildNavLi.length - 1));
            if (oSildeNavJRoll.obj === undefined) {
                oSildeNavJRoll.AddScroll(oSildeNavScroll[0], {
                    scrollY: false,
                    scrollX: true
                });
            } else {
                oSildeNavJRoll.ReScroll();
            }
        },
        // 导航滚动和页面同步
        SildeNavScrollDis: function(index, callBack) {
            var _dis = 0;
            // 导航滚动
            if (index >= oSildeNavUl.find("li").length - 3) {
                _dis = parseInt(oSildeNavScroll.width() - oSildeNavUl.width());
            } else if (index > 2) {
                _dis = nDisScrollLi * index;
            }
            oSildeNavJRoll.ScrollTo(_dis, 0, 100);
            if (callBack) callBack();
        },
        // 滚动隐藏搜索
        ScrollPage: function() {
            var _this = this;
            var minScrHeight = 300;
            _this.nHeaderHeight = parseInt(oHeader.outerHeight(true));
            _this.nSearchBoxHeight = parseInt(oSearchBox.outerHeight(true));
            _this.nSildeNavHeight = parseInt(oSildeNav.outerHeight(true));
            oSlidePageScroll.off("scroll");
            oSlidePageScroll.on("scroll", function() {
                var afterScroll = $(this).scrollTop();
                // 滚动页面距离底部300像素 延迟150毫秒加载数据
                clearTimeout(_this.time_Scroll);
                _this.time_Scroll = setTimeout(function() {
                    // console.log(afterScroll)
                    var index = ajaxData.navIndex;
                    // 统计曝光数据
                    ddjAction.viewGoods(oSlidePageScroll.eq(index).find(".js_slidePageMain"), index);
                    // 防止开始滚动改变数据
                    if (!ajaxData.tabLoadOff[index]) {
                        // 设置缓存记录
                        ajaxData.pageSCroll[index] = afterScroll;
                    }
                    // 显示隐藏回到顶部侧边框
                    _this.ShowGoTop(afterScroll);
                    _this.ScrollHide(afterScroll);
                    // 添加地区馆
                    if (oSlidePageScroll.eq(index).hasClass("areaListBox")) return;
                    if (oSlidePageScroll[index].scrollHeight - afterScroll - oSlidePageScroll.height() < minScrHeight) {
                        // 设置翻页到最后一页 返回
                        if (ajaxData.loadFinish[index]) {
                            oSlidePageScroll.eq(index).find(".js_loadingBtn").hide().eq(0).show();
                            return;
                        }
                        // 加载产品数据  防止第一次加载出现2次问题
                        if (!ajaxData.tabLoadOff[index]) {
                            ajaxData.GoodsAjaxData(index, false, function() {
                                ajaxData.pagearr[index]++;
                            });
                        }
                    }
                }, 500);
            });
        },
        // 显示回到顶部按钮
        ShowGoTop: function(scrollTop) {
            scrollTop > 300 ? oSideBox.stop().animate({
                right: 0
            }, 300) : oSideBox.stop().animate({
                right: "-3.5rem"
            }, 300);
        },
        // 页面滚动隐藏导航
        ScrollHide: function(scrollTop) {
            var _this = this;
            //console.log('scroll----:'+scrollTop);
            // 判断滚动距离隐藏搜索框和滚动方向 （不能提出成单独方法）
            if (scrollTop > _this.nHeaderHeight) {
                // oContain.css({'top':  _this.nSildeNavHeight});
                oHeader.css({
                    top: -_this.nSearchBoxHeight - 1
                }).find(".js_sildeNav").addClass("active");
            } else {
                // oContain.css({'top':  _this.nHeaderHeight -1});
                oHeader.css({
                    top: 0
                }).find(".js_sildeNav").removeClass("active");
            }
        },
        // 判断显不显示智能语音的入口
        showAIEntrance: function() {
            var url = "/member/partition";
            G_JSON_POST(url, {}, function(res) {
                // console.log('---',res);
                if (res == 0) {
                    oAIEntrance.show();
                }
            }, function(err) {});
        }
    };
    var ajaxData = {
        pagearr: [ 1 ],
        // 每个分页的翻页数
        pageSCroll: [ 0 ],
        // 每个分页滚动高度
        tabLoadOff: [ true ],
        // 左右滑动加载开关
        navIndex: 0,
        // 导航选中索引
        loadFinish: [ false ],
        // 加载完成
        dataStore: {
            0: []
        },
        // 数据存储
        dataStore_Off: [ true ],
        // 数据存储调用开关
        loadAdsCount: 0,
        // 加载计数
        locScrollTime: null,
        lockScroll: function() {
            var _this = this;
            _this.loadAdsCount++;
        },
        unlockScroll: function() {
            var _this = this;
            _this.loadAdsCount--;
            // 检测数据请求完后执行
            if (_this.loadAdsCount == 0) {
                loadOver();
            }
            function loadOver() {
                clearTimeout(_this.locScrollTime);
                _this.locScrollTime = setTimeout(function() {
                    oLoadingPage.hide();
                    _this.HisScrollTop(_this.navIndex);
                    // 统计曝光数据
                    ddjAction.viewGoods(oSlidePageScroll.eq(_this.navIndex).find(".js_slidePageMain"), _this.navIndex);
                }, 300);
            }
        },
        // 设置商品数据
        GoodsAjaxData: function(index, isInit, fn) {
            var _this = this;
            var nowStart = 0;
            var nowLimit = 0;
            // console.log("index  " + index + "  isInit  " + isInit + "  page  " + ajaxData.pagearr[index]);
            if (index == 0 && isInit) {
                nowStart = perLimit;
                nowLimit = perLimit * (ajaxData.pagearr[index] - 1);
            } else if (index == 0 && !isInit) {
                nowStart = perLimit * ajaxData.pagearr[index];
                nowLimit = perLimit;
            } else if (isInit) {
                nowStart = 0;
                nowLimit = perLimit * ajaxData.pagearr[index];
            } else {
                nowStart = perLimit * ajaxData.pagearr[index];
                nowLimit = perLimit;
            }
            var dataUrl = BASE_URL;
            var dataJson = {};
            if (index == 0) {
                dataUrl += "/shop/goods/loadGoods";
                dataJson = {
                    groupName: GROUP_NAME,
                    start: nowStart,
                    limit: nowLimit
                };
            } else if (index <= categoryData.length) {
                dataUrl += "/category/loadAll";
                dataJson = {
                    categoryId: categoryData[index - 1],
                    start: nowStart,
                    limit: nowLimit
                };
                // 用于 达观数据监测分类判断
                if (_this.tabLoadOff[index]) {
                    dataJson.is_first = 1;
                }
            } else {
                return;
            }
            // if(isInit) {
            //     _this.lockScroll()
            // }
            var _data = null;
            // console.log('设置数据', _this.dataStore[index] )
            // 从缓存中去值
            if (_this.dataStore_Off[index] && _this.dataStore[index].length > 0) {
                _this.dataStore_Off[index] = false;
                _data = _this.dataStore[index];
                setGoodsList(_data, index);
                if (fn) fn();
            } else {
                _this.dataStore_Off[index] = false;
                G_JSON_POST(dataUrl, dataJson, function(data) {
                    // _data = data;
                    data.goodsList ? _data = data.goodsList : _data = data;
                    if (_data.length > 0) {
                        setGoodsList(_data, index);
                        _this.saveData(_data, index);
                    }
                    if (_data.length == 0 || _data.length < nowLimit) {
                        oSlidePageScroll.eq(index).find(".js_loadingBtn").hide().eq(0).show();
                        ajaxData.loadFinish[index] = true;
                    }
                    if (fn) fn();
                }, function() {}, function() {
                    // end
                    if (_data == null) {
                        if (fn) fn();
                    }
                });
            }
            function setGoodsList(argData, index) {
                if (index == 0) {
                    connectHtml.GoodsLiHtml(argData, index, "showTwo");
                } else {
                    connectHtml.GoodsLiHtml(argData, index, "showOne");
                }
            }
        },
        // 历史数据定位
        HistoryInit: function(fn1, fn2) {
            var _this = this;
            if (sessionStorage.getItem("navIndex") != null) {
                _this.navIndex = sessionStorage.getItem("navIndex") * 1;
                _this.tabLoadOff[_this.navIndex] = false;
                sfddjIndex.SildeNavScrollDis(0, function() {
                    sfddjIndex.oSlidePageMain.slideTo(_this.navIndex, 100);
                });
                _this.GetSessionData();
                if (fn1) fn1(_this.navIndex);
            } else {
                // _this.tabLoadOff[0] = false;
                if (fn2) fn2();
            }
            // 给导航加上内容，须在导航索引更新之后
            sfddjIndex.slideNavInit();
        },
        // 历史滚动高度
        HisScrollTop: function(index) {
            var _this = this;
            oSlidePageScroll.eq(index).scrollTop(_this.pageSCroll[index]);
        },
        // 设置历史定位
        SetSession: function() {
            var _this = this;
            sessionStorage.setItem("navIndex", JSON.stringify(_this.navIndex));
            sessionStorage.setItem("pagearr", JSON.stringify(_this.pagearr));
            sessionStorage.setItem("pageSCroll", JSON.stringify(_this.pageSCroll));
            sessionStorage.setItem("dataStore", JSON.stringify(_this.dataStore));
        },
        // 通过历史数据设置初始数据
        GetSessionData: function() {
            var _this = this;
            var pageNum = sessionStorage.getItem("pagearr");
            var pageSCrollNum = sessionStorage.getItem("pageSCroll");
            var dataStoreList = sessionStorage.getItem("dataStore");
            if (pageNum != null) {
                // 设置页码数
                _this.pagearr = JSON.parse(pageNum);
            }
            if (pageSCrollNum != null) {
                // 设置页面滚动数据
                _this.pageSCroll = JSON.parse(pageSCrollNum);
            }
            if (dataStoreList != null) {
                // 设置历史商品数据
                _this.dataStore = JSON.parse(dataStoreList);
            }
        },
        // 存储历史数据
        saveData: function(data, index) {
            var _this = this;
            for (var i = 0; i < data.length; i++) {
                _this.dataStore[index].push(data[i]);
            }
        }
    };
    // 拼接HTML
    var connectHtml = {
        // 产品容器（并排和一排）
        GoodHtmlBox: function(data, bOff) {
            var _selet = bOff;
            //showTwo 并排  showOne 是一排
            var shmtlBox = "";
            var shmtlLoad = "";
            var goodsOneClass = "js_goods_showOne";
            var goodsTwoClass = "active js_goods_showTwo";
            function setGoodsHtmlBox(aClassName) {
                if (aClassName == goodsOneClass) {
                    shmtlLoad = '<div class="moreBtnBox">' + '<p class="loadingBtn js_loadingBtn" style="display:none;"><a>没有更多</a></p>' + '<p class="loadingBtn js_loadingBtn">' + '<span class="icon_loading icoStyle icon-spinner3 myRotateRefresh"></span>' + "<span>加载中</span>" + "</p>" + "</div>";
                }
                return shmtlBox = '<div class="goods_showChangeBox ' + aClassName + '">' + '<div class="goods_showChange">' + '<ul class="goodsList clearfix js_goodsList"></ul>' + "</div>" + shmtlLoad + "</div>";
            }
            if (_selet == "showTwo") {
                return setGoodsHtmlBox(goodsTwoClass);
            } else if (_selet == "showOne") {
                return setGoodsHtmlBox(goodsOneClass);
            } else {
                return setGoodsHtmlBox(goodsOneClass);
            }
        },
        // 并排产品列表
        GoodsLiHtml: function(data, iNow, showNum) {
            var _this = this;
            var shtml = "";
            var sfindClass = "";
            var _smallImgArg = smallImgArg;
            //  showNum == 'showTwo' ? sfindClass = 'js_goods_showTwo' : sfindClass = 'js_goods_showOne';
            if (showNum == "showTwo") {
                sfindClass = "js_goods_showTwo";
            } else {
                sfindClass = "js_goods_showOne";
                _smallImgArg = smallImgArg200;
            }
            var oGoodsShowLi = oSlidePageScroll.eq(iNow).find("." + sfindClass + "");
            // 判断是否需要放入容器和标题
            if (oGoodsShowLi.length == 0) {
                // 插入产品容器
                oSlidePageScroll.eq(iNow).find(".js_slidePageMain").append(_this.GoodHtmlBox(data, showNum));
                oGoodsShowLi = oSlidePageScroll.eq(iNow).find("." + sfindClass + "");
            }
            for (var i = 0; i < data.length; i++) {
                var goodsImgUrl = data[i].showImage != undefined ? HTTP_IMAGE_URL + data[i].showImage : BASE_URL + "/static_v4/image/loadImg.jpg";
                // 全额保障  选择性显示哪些右上角图标
                var html_firstGueeImagePath = "";
                if (data[i].firstGueeImagePath != null && data[i].firstGueeImagePath != "") {
                    html_firstGueeImagePath = '<div class="quanpei"><img src="' + data[i].firstGueeImagePath + '"alt="" /></div>';
                }
                // 新品 直降 单排名称前  双排左上角标记
                var html_goodsLabels_one = "";
                var html_goodsLabels_two = "";
                // 好吃 直降 底部提示
                var html_label = "";
                if (sfindClass == "js_goods_showOne") {
                    if (data[i].goodsLabels && data[i].goodsLabels != "") {
                        html_goodsLabels_one = '<i class="promotionHotIcon">' + data[i].goodsLabel + "</i>";
                    }
                    if (data[i].label && data[i].label != "") {
                        html_label = '<p class="promotionSale horpromotionSale">';
                        for (var j = 0; j < data[i].labels.length; j++) {
                            html_label += "<i>" + data[i].labels[j] + "</i>";
                        }
                        html_label += "</p>";
                    }
                }
                if (sfindClass == "js_goods_showTwo") {
                    if (data[i].goodsLabels && data[i].goodsLabels != "") {
                        html_goodsLabels_two = '<div class="verpromotionHot">' + "   <span>" + data[i].goodsLabel + "</span>" + '   <div><img src="' + BASE_URL + '/static_v4/image/iconImg/hotIcon.png" alt=""></div>' + "</div>";
                    }
                }
                // 团购标记
                var html_isTuangou = "";
                if (data[i].isTuangou) {
                    html_isTuangou = '<span class="goodsPrice">￥' + data[i].tuangouPrices + "</span>" + '<span class="tuangouNum">/<span>￥' + data[i].salePrice + "</span></span>";
                } else {
                    html_isTuangou = '<span class="goodsPrice">￥' + data[i].salePrice + "</span>";
                }
                // 达观数据设置
                var datagrandHref = "";
                var datagrandRequestId = "";
                var datagrandAddCar = "";
                var datagrandSceneType = "";
                if (data[i].requestId && data[i].requestid != "undefined" && data[i].requestid != "null") {
                    if (iNow > 0) {
                        datagrandHref = "?goodschannel=datagrand&recRequestId=" + data[i].requestId;
                        datagrandAddCar = "goodschannel=datagrand";
                    }
                    datagrandRequestId = data[i].requestId;
                } else {
                    if (iNow > 0) {
                        datagrandHref = "?goodschannel=not_datagrand";
                        datagrandAddCar = "goodschannel=not_datagrand";
                    }
                }
                if (iNow > 0) {
                    datagrandSceneType = "sceneType=cate";
                }
                shtml += "<li>" + '   <a class="BoxSelf" href="' + BASE_URL + "/h/goodspay/goodsView/" + data[i].goodsSn + datagrandHref + '" data-growing-title="' + data[i].name + '" requestId="' + datagrandRequestId + '" goodsId="' + data[i].id + '" ' + datagrandSceneType + ">" + "       <figure>" + '           <img class="js_lazyImg" data-echo="' + goodsImgUrl + _smallImgArg + '" ' + '           src="' + BASE_URL + '/static_v4/image/loadImg.jpg">' + html_firstGueeImagePath + html_goodsLabels_two + // '<i class="tip-info">' + data[i].discount + '</i>'+
                "       </figure>" + '       <aside class="priceArea VBox Bflex1">' + '           <div class="Bflex1 priceArea_name">' + "               <h4>" + html_goodsLabels_one + data[i].name + "</h4>" + '               <p class="smallFont_tip">' + data[i].title + "</p>" + "           </div>" + '           <div class="priceArea_price">' + // '                <i class="tip-info">' + data[i].discount + '</i>'+
                '               <p class="HBox priceAreaBox">' + // '                <span class="goodsPriceOld">￥' + data[i].oldPrice + '</span>'+
                html_isTuangou + "               </p>" + "           </div>" + "       </aside>" + "   </a>" + '   <p class="addCar js_addCar" pid="' + data[i].productId + '" requestId="' + data[i].requestId + '" ' + datagrandAddCar + " " + datagrandSceneType + ' ><em class="icon-shopcar_small"></em></p>' + html_label + "</li>";
            }
            var oShtml = $(shtml);
            oGoodsShowLi.find(".js_goodsList").append(oShtml);
            if (showNum == "showTwo") {
                myPub.SetImgHeight(oShtml);
            }
            lazLoading.DestroyLazLoadingImg();
            lazLoading.AddLazLoadingImg(oSlidePageScroll[iNow]);
            shtml = null;
            // sAddCarHtml = null;
            data = null;
        },
        // 新人优惠券弹框
        newFriendHtml: function() {
            var shtml = "";
            var html_counponNewData = "";
            if (counponNewData && counponNewData.length > 0) {
                for (var i = 0; i < counponNewData.length; i++) {
                    var beginDate = myPub.FormatDateTime(new Date(counponNewData[i].beginDate), "minDay", ".");
                    var endDate = myPub.FormatDateTime(new Date(counponNewData[i].endDate), "minDay", ".");
                    html_counponNewData += '<div class="counponSin">' + '   <div class="indexConBg">' + '       <img src="' + BASE_URL + '/static_v4/image/invite/IndexConBg.png" alt="">' + "   </div>" + '   <div class="indexConTex HBox BoxCenter">' + '       <div class="conTexLe">' + '           <p class="conTexPrice">￥<span>' + counponNewData[i].costPrice + "</span></p>" + '           <p class="conTexTerm">' + counponNewData[i].needPrice + "</p>" + "       </div>" + '       <div class="conTexRi Bflex1">' + '           <p class="conTexDes">' + counponNewData[i].couponName + "</p>" + '           <p class="conTexTime">' + beginDate + "-" + endDate + "</p>" + "       </div>" + "   </div>" + "</div>";
                }
            } else {
                html_counponNewData = '<p class="nullCou">注册成功，优惠券将在7日内到帐</p>';
            }
            shtml += '<div class="js_inviteAd layer_Ads layer_Ads_invite">' + '   <div class="layer_Adsinvite">' + '       <div class="layer_inviteImgBox">' + '               <div class="inviteIndexBg">' + '                   <img src="' + BASE_URL + '/static_v4/image/invite/invitenIdexF.png" alt="">' + "               </div>" + '               <div class="counponBg">' + '                   <div class="couOverflow">' + html_counponNewData + "                   </div>" + "               </div>" + "       </div>" + '       <div class="layer_inviteCloseBtn">' + '           <img class="js_layer_inviteCloseBtn" src="' + BASE_URL + '/static_v4/image/invite/inviteClose.png" alt="">' + "       </div>" + "   </div>" + "</div>";
            var oShtml = $(shtml);
            oWrap.append(oShtml);
            var oInviteClose = $(".js_layer_inviteCloseBtn");
            // 新人优惠券关闭按钮
            // 关闭新人优惠券弹窗
            oInviteClose.hammer().off("tap");
            oInviteClose.hammer().on("tap", function(e) {
                $(".layer_Ads_invite").hide();
                sessionStorage.removeItem("judgeNew_friend");
                sessionStorage.removeItem("judgeNew_friend_coupons");
                e.preventDefault();
            });
        },
        //导航弹窗内容
        slideNavHtml: function(data) {
            var newData = [ "推荐" ].concat(data);
            var shtml = "";
            for (var i = 0; i < newData.length; i++) {
                var names = newData[i];
                var addClass = ajaxData.navIndex == i ? "active" : "";
                shtml += '<li class="slideNavLi js_newSlideNavLi ' + addClass + '"   slideIndex="' + i + '"><p class="slideNavLiCon">' + names + "</p></li>";
            }
            return shtml;
        }
    };
    // 用户行为     
    var ddjAction = {
        viewData: [],
        viewGoods: function(obj, iNow) {
            // 首页和分类区分
            var ddjActionPositionId = {};
            ddjActionPositionId.positionFirst = "首页";
            if (iNow > 0) {
                ddjActionPositionId.positionId = 2;
                ddjActionPositionId.positionSecond = categoryNames[iNow - 1];
            } else {
                ddjActionPositionId.positionId = 1;
                ddjActionPositionId.positionSecond = "推荐";
            }
            // 统计曝光数据
            visualArea.viewEl.showViewEls(obj, function(data, dataJson) {
                ddjhoc.setData(data, "rec_show", "add", function() {
                    console.log("ddjhoc.params.rec_show.index", ddjhoc.params);
                    if (ddjhoc.params.length != 0) ddjhoc.sendData(ddjhoc.params);
                    console.log("ddjhoc.ddjParams.rec_show.index", ddjhoc.ddjParams);
                    if (ddjhoc.ddjParams.length != 0) ddjhoc.sendDDJData(ddjhoc.ddjParams);
                }, dataJson, ddjActionPositionId);
            });
        }
    };
});
/**
 *  广告模块整合 20171023
 */
define("static_v4/js/mod/adsModel", [ "./public", "./visualAreaInfo" ], function(require, exports, module) {
    var myPub = require("./public");
    // 曝光可视区域元素
    var visualArea = require("./visualAreaInfo");
    var htmlFontSize, intSize, stretchs, stretchLong;
    var resizeTimer = null;
    // 页面尺寸修改
    $(window).on("resize", function() {
        if (resizeTimer) {
            clearTimeout(resizeTimer);
        }
        resizeTimer = setTimeout(function() {
            htmlFontSize = $("html").css("font-size");
            intSize = parseInt(htmlFontSize.split("p")[0]);
            stretchs = 174 / 26 * intSize;
            stretchLong = intSize;
            var oAdvert = $(".jsAdvert");
            var oAdsHRotateBox = oAdvert.eq(adsAjax.pageIndex).find(".js_AdsHRotateBox");
            oAdsHRotateBox.each(function(i) {
                adsInit.SetAdsRotate(stretchs, oAdsHRotateBox.eq(i), adsAjax.pageIndex);
            });
            var oAdsLong_HScrollSwiper = oAdvert.eq(adsAjax.pageIndex).find(".js_AdsLong_HScrollBox");
            oAdsLong_HScrollSwiper.each(function(i) {
                adsInit.SetAdsLongSwiper(stretchLong, oAdsLong_HScrollSwiper.eq(i), adsAjax.pageIndex);
            });
        }, 400);
    });
    // var BASE_URL = '';
    var adsInit = {
        time_CutTime: null,
        // 倒计时计时器
        time_RunHouse: null,
        // 头条计时器
        oSlideAdsScroll: [],
        // 横排滚动广告
        oSlideAdsRotate: [],
        // 旋转滚动广告
        oSlideAdsLongSwiper: [],
        // 长形滚动广告
        oSlideAdsIconSwiper: [],
        // icon滚动广告
        // 设置长条滚动广告
        SetAdsLongSwiper: function(stretch, obj, iNow) {
            var _this = this;
            var swiperIndex = obj.index();
            // var oAdsLong_HScrollSwiper = $('.js_AdsLong_HScrollSwiper');
            var oAdsLong_HScrollSwiper = obj.find(".js_AdsLong_HScrollSwiper");
            var isSwiper = null;
            iNow ? iNow : 0;
            if (_this.oSlideAdsLongSwiper[iNow] == undefined) {
                _this.oSlideAdsLongSwiper[iNow] = [];
                _this.oSlideAdsLongSwiper[iNow].swiper = [];
            }
            if (stretch === undefined) {
                var _htmlFontSize = $("html").css("font-size");
                var _intSize = parseInt(_htmlFontSize.split("p")[0]);
                stretch = _intSize;
            }
            if (_this.oSlideAdsLongSwiper[iNow].swiper[swiperIndex] == undefined) {
                AddSwiper(stretch);
            } else {
                _this.oSlideAdsLongSwiper[iNow].swiper[swiperIndex].destroy();
                _this.oSlideAdsLongSwiper[iNow].swiper[swiperIndex] = null;
                AddSwiper(stretch);
            }
            function AddSwiper(stretch) {
                isSwiper = oAdsLong_HScrollSwiper.swiper({
                    pagination: null,
                    loop: true,
                    loopAdditionalSlides: 1,
                    // observer: true,
                    // observeParents: true,
                    slidesOffsetBefore: -stretch * .462,
                    autoplay: 3e3,
                    autoplayDisableOnInteraction: false,
                    effect: "coverflow",
                    slidesPerView: 1.039,
                    centeredSlides: true,
                    coverflow: {
                        rotate: 0,
                        stretch: -stretch,
                        depth: 75,
                        modifier: 4,
                        slideShadows: false
                    },
                    onTouchEnd: function(swiper) {
                        var index = swiper.activeIndex;
                        var _swSlid = oAdsLong_HScrollSwiper.find(".swiper-slide a");
                        var swiper_href = _swSlid.eq(index).attr("swiper_href");
                        if (typeof swiper_href != "undefined") {
                            _swSlid.removeAttr("href").eq(index).attr("href", swiper_href);
                        }
                        ddjAction.viewGoods(obj, iNow);
                    }
                });
                _this.oSlideAdsLongSwiper[iNow].swiper[swiperIndex] = isSwiper;
            }
        },
        // 设置旋转滚动广告
        SetAdsRotate: function(stretch, obj, iNow) {
            var _this = this;
            var swiperIndex = obj.index();
            // var oHRotateBox = $('.js_HRotate');
            var oHRotateBox = obj.find(".js_HRotate");
            var oPagin = oHRotateBox.find(".js_pagin");
            var isSwiper = null;
            iNow ? iNow : 0;
            if (_this.oSlideAdsRotate[iNow] == undefined) {
                _this.oSlideAdsRotate[iNow] = [];
                _this.oSlideAdsRotate[iNow].swiper = [];
            }
            if (stretch === undefined) {
                var _htmlFontSize = $("html").css("font-size");
                var _intSize = parseInt(_htmlFontSize.split("p")[0]);
                stretch = 174 / 26 * _intSize;
            }
            if (_this.oSlideAdsRotate[iNow].swiper[swiperIndex] == undefined) {
                AddSwiper(stretch);
            } else {
                _this.oSlideAdsRotate[iNow].swiper[swiperIndex].destroy();
                _this.oSlideAdsRotate[iNow].swiper[swiperIndex] = null;
                AddSwiper(stretch);
            }
            function AddSwiper(stretch) {
                isSwiper = oHRotateBox.swiper({
                    pagination: oPagin,
                    loop: true,
                    loopAdditionalSlides: 1,
                    // observer: true,
                    // observeParents: true,
                    roundLengths: true,
                    followFinger: false,
                    autoplay: 3e3,
                    autoplayDisableOnInteraction: false,
                    effect: "coverflow",
                    slidesPerView: 2.14,
                    centeredSlides: true,
                    coverflow: {
                        rotate: 0,
                        stretch: stretch,
                        depth: 200,
                        modifier: 1,
                        slideShadows: false
                    },
                    onTouchEnd: function(swiper) {
                        var index = swiper.activeIndex;
                        var _swSlid = oHRotateBox.find(".swiper-slide a");
                        var swiper_href = _swSlid.eq(index).attr("swiper_href");
                        if (typeof swiper_href != "undefined") {
                            _swSlid.removeAttr("href").eq(index).attr("href", swiper_href);
                        }
                        ddjAction.viewGoods(obj, iNow);
                    }
                });
                _this.oSlideAdsRotate[iNow].swiper[swiperIndex] = isSwiper;
            }
        },
        // 设置滚动广告
        SetAdsLiScroll: function(obj, iNow) {
            var _this = this;
            // var oHScrollBox = $('.js_HScroll');
            // var oHScrollBox = obj ? obj.find('.js_HScroll') : $('.js_HScroll');
            var swiperIndex = obj.index();
            var oHScrollBox = obj.find(".js_HScroll");
            var isSwiper = null;
            iNow ? iNow : 0;
            if (_this.oSlideAdsScroll[iNow] == undefined) {
                _this.oSlideAdsScroll[iNow] = [];
                _this.oSlideAdsScroll[iNow].swiper = [];
            }
            if (_this.oSlideAdsScroll[iNow].swiper[swiperIndex] == undefined) {
                AddSwiper();
            } else {
                _this.oSlideAdsScroll[iNow].swiper[swiperIndex].destroy();
                _this.oSlideAdsScroll[iNow].swiper[swiperIndex] = null;
                AddSwiper();
            }
            function AddSwiper() {
                isSwiper = oHScrollBox.swiper({
                    freeMode: true,
                    freeModeMomentumRatio: 1,
                    freeModeMomentumVelocityRatio: 1,
                    freeModeMomentumBounce: false,
                    freeModeSticky: true,
                    lazyLoading: true,
                    watchSlidesProgress: true,
                    watchSlidesVisibility: true,
                    slideClass: "slide-HScroll",
                    slidesPerView: "auto",
                    onSlideChangeEnd: function(swiper) {
                        ddjAction.viewGoods(obj, iNow);
                    }
                });
                _this.oSlideAdsScroll[iNow].swiper[swiperIndex] = isSwiper;
            }
        },
        // 设置icon图滚动广告
        SetAdsIconSwiper: function(obj, iNow) {
            var _this = this;
            var swiperIndex = obj.index();
            // var oHScrollBox = $('.js_IconSwiper');
            var oHScrollBox = obj.find(".js_IconSwiper");
            var isSwiper = null;
            iNow ? iNow : 0;
            if (_this.oSlideAdsIconSwiper[iNow] == undefined) {
                _this.oSlideAdsIconSwiper[iNow] = [];
                _this.oSlideAdsIconSwiper[iNow].swiper = [];
            }
            if (_this.oSlideAdsIconSwiper[iNow].swiper[swiperIndex] == undefined) {
                AddSwiper();
            } else {
                _this.oSlideAdsIconSwiper[iNow].swiper[swiperIndex].destroy();
                _this.oSlideAdsIconSwiper[iNow].swiper[swiperIndex] = null;
                AddSwiper();
            }
            function AddSwiper() {
                isSwiper = oHScrollBox.swiper({
                    pagination: ".js_IconSwiperPagination",
                    // lazyLoading: true,
                    // lazyLoadingInPrevNextAmount: 4,
                    watchSlidesProgress: true,
                    watchSlidesVisibility: true,
                    slidesPerView: "5",
                    observer: true,
                    observeParents: true,
                    onTouchEnd: function(swiper) {
                        ddjAction.viewGoods(obj, iNow);
                    }
                });
                _this.oSlideAdsIconSwiper[iNow].swiper[swiperIndex] = isSwiper;
            }
        },
        // 倒计时
        CutDataTime: function() {
            var _this = this;
            var oActTimeShow = $(".act-timeShow");
            // var oActTimeShow = obj ? obj.find('.act-timeShow') : $('.act-timeShow');
            if (oActTimeShow.length == 0) return;
            var ss = _this.cutTimeToday() % 60;
            var mm = (_this.cutTimeToday() - ss) / 60 % 60;
            var hh = (_this.cutTimeToday() - _this.cutTimeToday() % 3600) / 3600;
            ss = ss < 10 ? "0" + ss : ss;
            mm = mm < 10 ? "0" + mm : mm;
            hh = hh < 10 ? "0" + hh : hh;
            var sHtml = '<span class="timeShow timeBg-black">' + hh + "</span><i>/</i>" + '<span class="timeShow timeBg-black">' + mm + "</span><i>/</i>" + '<span class="timeShow timeBg-red">' + ss + "</span>";
            oActTimeShow.empty().append(sHtml);
            sHtml = null;
            clearTimeout(_this.time_CutTime);
            _this.time_CutTime = setTimeout(function() {
                _this.CutDataTime();
            }, 1e3);
        },
        // 头条跑马灯
        RunHouse: function(obj, iNow) {
            var _this = this;
            ddjAction.viewGoods(obj, iNow);
            // var oHotMessageUl = $('.js_hotMessage ul');
            var oHotMessageUl = obj ? obj.find(".js_hotMessage ul") : $(".js_hotMessage ul");
            oHotMessageUl.append(oHotMessageUl.html());
            var oHotMessageLI = oHotMessageUl.find("li");
            if (oHotMessageLI.length == 0) return;
            var oLiH = parseInt(oHotMessageLI.outerHeight(true));
            var nLilength = oHotMessageLI.length;
            var disUlTop = 0;
            oHotMessageUl.css({
                top: -disUlTop
            });
            oHotMessageUl.on("touchstart", function() {
                clearTimeout(_this.time_RunHouse);
            });
            oHotMessageUl.on("touchend", function() {
                _this.time_RunHouse = setTimeout(Move, 2500);
            });
            Move();
            function Move() {
                if (disUlTop >= oLiH * (nLilength - 1) / 2) {
                    disUlTop = oLiH;
                    oHotMessageUl.stop().animate({
                        top: -disUlTop
                    }, 300);
                } else {
                    disUlTop += oLiH;
                    oHotMessageUl.stop().animate({
                        top: -disUlTop
                    }, 300, function() {
                        if (disUlTop == oLiH * nLilength / 2) {
                            oHotMessageUl.stop().animate({
                                top: 0
                            }, 0);
                        }
                    });
                }
                clearTimeout(_this.time_RunHouse);
                _this.time_RunHouse = setTimeout(Move, 2500);
            }
        },
        // 当天倒计时
        cutTimeToday: function() {
            var date = new Date();
            date.setMilliseconds(0);
            var nowDate = date.getTime();
            date.setHours(0);
            date.setMinutes(0);
            date.setSeconds(0);
            date.setDate(date.getDate() + 1);
            var nextDay = date.getTime();
            var diffTime = (nextDay - nowDate) / 1e3;
            return diffTime;
        }
    };
    exports.adsInit = adsInit;
    var adsHtml = {
        // 广告banner  1行一个
        AdsBanner: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var shtml = "";
            var adItems = JSON.parse(advertItem.items);
            for (var i = 0; i < adItems.length; i++) {
                var item = adItems[i];
                var cLink = _this.GetAdsLink(item.linkType, item.link);
                shtml += '<li><a href="' + cLink + '" data-growing-title="' + advertItem.moduleName + i + '" requestId="' + advertItem.requestId + '"  goodsid="' + advertItem.id + '"><img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + i + '" ></a></li>';
            }
            var shtmlBox = '<section class="AdsImgShow AdsImgShow js_AdsImgShowBanner">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="AdsImgShowBox">' + '           <div class="AdsImgShowBanner HBox BoxCenter">' + '               <div class="Ads-bannerList Bflex1">' + "                   <ul>" + shtml + "</ul>" + "               </div>" + "            </div>" + "       </div>" + "   </div>" + "</section>";
            var $shtmlBox = $(shtmlBox);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $shtmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($shtmlBox);
            shtml = null;
            shtmlBox = null;
            oSlidePageScroll = null;
            adItems = null;
        },
        // 横排图标滚动广告
        // AdsHorizontal: function (advertItem, iNow) {
        //     var _this = this;
        //     var oSlidePageScroll = $('.js_slidePageScroll');
        //     var shtml = '';
        //     var adItems = JSON.parse(advertItem.items);
        //     for (var i=0; i < adItems.length; i++) {
        //         var item = adItems[i];
        //         var cLink = _this.GetAdsLink(item.linkType,item.link);
        //         shtml +=
        //             '<div class="swiper-slide">' +
        //             '   <a href="' + cLink + '" data-growing-title="'+advertItem.moduleName+i+'">' +
        //             '      <figure>' +
        //             '         <img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="'+advertItem.moduleName+i+'">' +
        //             '      </figure>' +
        //             // '   <aside>'+item.title+'</aside>' +
        //             '    </a>' +
        //             '</div>';
        //     }
        //     var shtmlBox =
        //         '<section class="AdsImgShow AdsInterval_gray ads-hor-finiteScroll">' +
        //         '   <div class="ads-white-interval" style="background-color: #'+advertItem.topIntervalColor+'"></div>'+
        //         '   <div class="AdsImgMain act-noPadding js_AdsImgMain" style="background-color: #'+advertItem.backgroundColor+'">'+
        //         '       <div class="ads-horList">'+
        //         '           <div class="swiper-container js_IconSwiper">'+
        //         '               <div class="swiper-wrapper">'+
        //                             shtml +
        //         '               </div>' +
        //         '           </div>' +
        //         '           <div class="swiper-pagination js_IconSwiperPagination"></div>'+
        //         '       </div>'+
        //         '   </div>'+
        //         '</section>';
        //     var $shtmlBox = $(shtmlBox);
        //     if(advertItem.spacing != null && advertItem.spacing == 1){
        //         $shtmlBox.addClass("AdsInterval_gray")
        //     }
        //     oSlidePageScroll.eq(iNow).find('.jsAdvert').append($shtmlBox);
        //     adsInit.SetAdsIconSwiper($shtmlBox, iNow);
        //     // 检测图片加载完成后处理
        //     var AdsHorImg =  oSlidePageScroll.eq(iNow).find('.js_IconSwiper img');
        //     var _iNum = 0;
        //     AdsHorImg.hide();
        //     AdsHorImg.each(function (i) {
        //         AdsHorImg[i].onload = function () {
        //             _iNum++;
        //             if(_iNum == AdsHorImg.length) {
        //                 AdsHorImg.parents('figure').css({'height': 'auto'});
        //                 AdsHorImg.show();
        //             }
        //         }
        //     });
        //     // oSlidePageScroll.eq(iNow).find('.js_ads-hor-finite figure').css({'height': 'auto'});
        //     shtml = null;
        //     shtmlBox = null;
        //     oSlidePageScroll = null;
        //     adItems = null;
        // },
        // 横排分类广告
        AdsHorizontal: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var shtml = "";
            var adItems = JSON.parse(advertItem.items);
            var shtmlBox = "";
            if (adItems.length < 6) {
                for (var i = 0; i < adItems.length; i++) {
                    var item = adItems[i];
                    var cLink = _this.GetAdsLink(item.linkType, item.link);
                    shtml += '<li class="Bflex1">' + '            <a href="' + cLink + '" data-growing-title="' + advertItem.moduleName + i + '">' + "               <figure>" + '                   <img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + i + '">' + "               </figure>" + // '            <aside>'+item.title+'</aside>' +
                    "            </a>" + "          </li>";
                }
                shtmlBox += '<section class="AdsImgShow ads-hor-finite js_ads-hor-finite">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-image: url(' + HTTP_IMAGE_URL + advertItem.backgroundImg + ');background-size: 100% 100%;background-repeat: no-repeat;">' + '       <div class="ads-horList">' + '           <ul class="HBox BoxCenter">' + shtml + "</ul>" + "       </div>" + "   </div>" + "</section>";
            } else if (adItems.length == 6) {
                for (var i = 0; i < adItems.length; i++) {
                    var item = adItems[i];
                    var cLink = _this.GetAdsLink(item.linkType, item.link);
                    shtml += '<div class="swiper-slide">' + '   <a href="' + cLink + '" data-growing-title="' + advertItem.moduleName + i + '" requestId="' + advertItem.requestId + '" goodsid="' + advertItem.id + '">' + "      <figure>" + '         <img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + i + '">' + "      </figure>" + // '   <aside>'+item.title+'</aside>' +
                    "    </a>" + "</div>";
                }
                shtmlBox += '<section class="AdsImgShow ads-hor-finiteScroll">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain act-noPadding js_AdsImgMain" style="background-image: url(' + HTTP_IMAGE_URL + advertItem.backgroundImg + ');background-size: 100% 100%;background-repeat: no-repeat;">' + '       <div class="ads-horList">' + '           <div class="swiper-container js_IconSwiper">' + '               <div class="swiper-wrapper">' + shtml + "               </div>" + '               <div class="swiper-pagination js_IconSwiperPagination"></div>' + "           </div>" + "       </div>" + "   </div>" + "</section>";
            }
            var $shtmlBox = $(shtmlBox);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $shtmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($shtmlBox);
            // 检测图片加载完成后处理
            var AdsHorImg = oSlidePageScroll.eq(iNow).find(".js_ads-hor-finite img");
            var _iNum = 0;
            AdsHorImg.hide();
            AdsHorImg.each(function(i) {
                AdsHorImg[i].onload = function() {
                    _iNum++;
                    if (_iNum == AdsHorImg.length) {
                        AdsHorImg.parents("figure").css({
                            height: "auto"
                        });
                        AdsHorImg.show();
                    }
                };
            });
            // oSlidePageScroll.eq(iNow).find('.js_ads-hor-finite figure').css({'height': 'auto'});
            adsInit.SetAdsIconSwiper($shtmlBox, iNow);
            shtml = null;
            shtmlBox = null;
            adItems = null;
        },
        // 横排分类广告 Min
        AdsHorizontalMin: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var shtml = "";
            var adItems = JSON.parse(advertItem.items);
            var shtmlBox = "";
            if (adItems.length < 6) {
                for (var i = 0; i < adItems.length; i++) {
                    var item = adItems[i];
                    var cLink = _this.GetAdsLink(item.linkType, item.link);
                    shtml += '<li class="Bflex1">' + '           <a href="' + cLink + '"data-growing-title="' + advertItem.moduleName + i + '">' + "               <figure>" + '                   <img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + i + '">' + "               </figure>" + // '                <aside>'+item.title+'</aside>' +
                    "           </a>" + "         </li>";
                }
                shtmlBox += '<section class="AdsImgShow ads-hor-finite js_ads-hor-finite-min act-noPadding">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-image: url(' + HTTP_IMAGE_URL + advertItem.backgroundImg + ');background-size: 100% 100%;background-repeat: no-repeat;">' + '       <div class="ads-horList-min">' + '           <ul class="HBox BoxCenter">' + shtml + "</ul>" + "       </div>" + "   </div>" + "</section>";
            } else if (adItems.length == 6) {
                for (var i = 0; i < adItems.length; i++) {
                    var item = adItems[i];
                    var cLink = _this.GetAdsLink(item.linkType, item.link);
                    shtml += '<div class="swiper-slide">' + '   <a href="' + cLink + '" data-growing-title="' + advertItem.moduleName + i + '" requestId="' + advertItem.requestId + '" goodsid="' + advertItem.id + '">' + "      <figure>" + '         <img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + i + '">' + "      </figure>" + // '   <aside>'+item.title+'</aside>' +
                    "    </a>" + "</div>";
                }
                shtmlBox += '<section class="AdsImgShow ads-hor-finiteScroll">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain act-noPadding js_AdsImgMain" style="background-image: url(' + HTTP_IMAGE_URL + advertItem.backgroundImg + ');background-size: 100% 100%;background-repeat: no-repeat;">' + '       <div class="ads-horList">' + '           <div class="swiper-container js_IconSwiper">' + '               <div class="swiper-wrapper">' + shtml + "               </div>" + '           <div class="swiper-pagination js_IconSwiperPagination"></div>' + "           </div>" + "       </div>" + "   </div>" + "</section>";
            }
            var $shtmlBox = $(shtmlBox);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $shtmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($shtmlBox);
            // 检测图片加载完成后处理
            var AdsHorImg = oSlidePageScroll.eq(iNow).find(".js_ads-hor-finite-min img");
            var _iNum = 0;
            AdsHorImg.hide();
            AdsHorImg.each(function(i) {
                AdsHorImg[i].onload = function() {
                    _iNum++;
                    if (_iNum == AdsHorImg.length) {
                        AdsHorImg.parents("figure").css({
                            height: "auto"
                        });
                        AdsHorImg.show();
                    }
                };
            });
            adsInit.SetAdsIconSwiper($shtmlBox, iNow);
            shtml = null;
            shtmlBox = null;
            oSlidePageScroll = null;
            adItems = null;
        },
        // 广告组2个图
        AdsGroup2: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            if (adItems.length != 2) {
                return;
            }
            var cLink0 = _this.GetAdsLink(adItems[0].linkType, adItems[0].link);
            var cLink1 = _this.GetAdsLink(adItems[1].linkType, adItems[1].link);
            var sectionHtml = '<section class="AdsImgShow js_AdsGroup2 AdsGroup2">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="AdsImgShowBox">' + '           <div class="AdsImgShow1-1 HBox">' + '               <div class="AdsImg-href-left Bflex1">' + '                   <ul class="VBox">' + '                       <li class="Bflex1">' + '                           <a href="' + cLink0 + '" data-growing-title="' + advertItem.moduleName + 0 + '" >' + '                               <img src="' + HTTP_IMAGE_URL + adItems[0].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 0 + '">' + "                           </a>" + "                       </li>" + "                   </ul>" + "                </div>" + '                <div class="AdsImg-href-right Bflex1 ">' + '                   <ul class="VBox">' + '                       <li class="Bflex1">' + '                           <a href="' + cLink1 + '" data-growing-title="' + advertItem.moduleName + 1 + '" >' + '                               <img src="' + HTTP_IMAGE_URL + adItems[1].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 1 + '">' + "                           </a>" + "                       </li>" + "                   </ul>" + "               </div>" + "           </div>" + "       </div>" + "   </div>" + "</section>";
            var $sectionHtml = $(sectionHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $sectionHtml.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($sectionHtml);
            sectionHtml = null;
            oSlidePageScroll = null;
            adItems = null;
        },
        // 广告组3个图
        AdsGroup3: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            if (adItems.length != 3) {
                return;
            }
            var cLink0 = _this.GetAdsLink(adItems[0].linkType, adItems[0].link);
            var cLink1 = _this.GetAdsLink(adItems[1].linkType, adItems[1].link);
            var cLink2 = _this.GetAdsLink(adItems[2].linkType, adItems[2].link);
            var sectionHtml = '<section class="AdsImgShow AdsImgShow AdsGroup3 js_AdsGroup3">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="AdsImgShowBox">' + '           <div class="AdsImgShow1-2 HBox">' + '               <div class="AdsImg-href-left">' + '                   <ul class="VBox">' + '                       <li class="Bflex1">' + '                           <a href="' + cLink0 + '" data-growing-title="' + advertItem.moduleName + 0 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[0].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 0 + '">' + "                           </a>" + "                       </li>" + "                   </ul>" + "                </div>" + '                <div class="AdsImg-href-right VBox Bflex1 ">' + '                   <ul class="VBox Bflex1">' + '                       <li class="Bflex1">' + '                           <a href="' + cLink1 + '" data-growing-title="' + advertItem.moduleName + 1 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[1].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 1 + '">' + "                           </a>" + "                       </li>" + '                       <li class="Bflex1">' + '                           <a href="' + cLink2 + '" data-growing-title="' + advertItem.moduleName + 2 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[2].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 2 + '">' + "                           </a>" + "                       </li>" + "                   </ul>" + "               </div>" + "           </div>" + "       </div>" + "   </div>" + "</section>";
            var $sectionHtml = $(sectionHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $sectionHtml.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($sectionHtml);
            sectionHtml = null;
            oSlidePageScroll = null;
            adItems = null;
        },
        // 广告组5个图
        AdsGroup5: function() {},
        // 今日头条
        AdsHeadline: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var boxHtml = '<section class="AdsImgShow ads-hotMessage">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + "   </div>" + "</section>";
            var $htmlBox = $(boxHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $htmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($htmlBox);
            var headlineUrl = BASE_URL + "/news/getShowNews";
            G_JSON_POST(headlineUrl, {}, function(data) {
                if (data.length <= 0) {
                    return;
                }
                var listHtml = '<div class="hotMessage HBox BoxCenter border_top">' + "   <figure>" + '       <img src="' + BASE_URL + '/static_v4/image/icons-ads/icon-ddjads-hotMessage.png" alt="">' + // '    <span class="splitline"></span>' +
                "   </figure>" + '   <div class="hotMessage-text Bflex1 js_hotMessage">' + '      <ul class="headLineList">' + "      </ul>" + "   </div>" + "</div>";
                var $listHtml = $(listHtml);
                $htmlBox.find(".js_AdsImgMain").append($listHtml);
                var $headlineList = $listHtml.find(".headLineList");
                for (var idx = 0; idx < data.length; idx++) {
                    var item = data[idx];
                    var headlineLi = "";
                    var _href = "";
                    var _typeId = "";
                    var _signHtml = '<span class="iconStyle icon-rob"></span>';
                    // 判断是商品链接还是新闻链接
                    if (item.type == 1) {
                        _href = BASE_URL + "/h/goodspay/goodsView/";
                        _typeId = item.goodsSn;
                    } else {
                        _href = BASE_URL + "/news/detail/";
                    }
                    // 判断是否添加抢购标记
                    // if(item.type == 2) {
                    //     _signHtml = '<span class="iconStyle icon-rob"></span>'；
                    // }
                    headlineLi = '<li><a class="HBox BoxCenter" href="' + _href + _typeId + '" requestId="' + item.requestId + '">' + _signHtml + '<span class="Bflex1">' + item.title + "</span></a></li>";
                    $headlineList.append(headlineLi);
                }
                adsInit.RunHouse(oSlidePageScroll.eq(iNow), iNow);
                boxHtml = null;
                listHtml = null;
                oSlidePageScroll = null;
                data = null;
            }, function() {}, function() {});
        },
        // 1+4
        AdsOneFour: function(advertItem, iNow) {
            var _this = this;
            var adItems = JSON.parse(advertItem.items);
            if (adItems.length == 6) {
                var titleImage = HTTP_IMAGE_URL + adItems[0].titleImage;
                var advertHtml = [ '<section class="AdsImgShow AdsImgShow AdsGroup1-4">', '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>', '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">', '	    <!--<div class="goods_title HBox">-->', '	    	<!--<img src="' + titleImage + '" alt="">-->', "	    <!--</div>-->", "	    <!-- 1+4广告  -->", '	    <div class="AdsImgShowBox">', '	    	<div class="AdsImgShow1-4 HBox">', '	    		<div class="AdsImg-href-left">', '	    			<ul class="VBox">', '	    				<li class="Bflex1">' + '                 <a href="' + _this.GetAdsLink(adItems[1].linkType, adItems[1].link) + '" data-growing-title="' + advertItem.moduleName + 1 + '">' + '                    <img src="' + HTTP_IMAGE_URL + adItems[1].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 1 + '">' + "                 </a>" + "             </li>", "	    			</ul>", "	    		</div>", '	    		<div class="AdsImg-href-right VBox Bflex1 ">', '	    			<ul class="VBox Bflex1">', '	    				<li class="Bflex1 HBox">', '	    					<div class="Bflex1 left_Box"><a href="' + _this.GetAdsLink(adItems[2].linkType, adItems[2].link) + '" data-growing-title="' + advertItem.moduleName + 2 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[2].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 2 + '"></a></div>', '	    					<div class="Bflex1 right_Box"><a href="' + _this.GetAdsLink(adItems[3].linkType, adItems[3].link) + '" data-growing-title="' + advertItem.moduleName + 3 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[3].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 3 + '"></a></div>', "	    				</li>", '	    				<li class="Bflex1 HBox">', '	    					<div class="Bflex1 left_Box"><a href="' + _this.GetAdsLink(adItems[4].linkType, adItems[4].link) + '" data-growing-title="' + advertItem.moduleName + 4 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[4].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 4 + '"></a></div>', '	    					<div class="Bflex1 right_Box"><a href="' + _this.GetAdsLink(adItems[5].linkType, adItems[5].link) + '" data-growing-title="' + advertItem.moduleName + 5 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[5].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 5 + '"></a></div>', "	    				</li>", "	    			</ul>", "	    		</div>", "	    	</div>", "	    </div>", "   </div>", "</section>" ].join("");
            } else if (adItems.length == 5) {
                var titleImage = HTTP_IMAGE_URL + adItems[0].titleImage;
                var advertHtml = [ '<section class="AdsImgShow AdsImgShow AdsGroup1-4">', '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>', '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">', '	    <!--<div class="goods_title HBox">-->', '	    	<!--<img src="' + titleImage + '" alt="">-->', "	    <!--</div>-->", "	    <!-- 1+4广告  -->", '	    <div class="AdsImgShowBox">', '	    	<div class="AdsImgShow1-4 HBox">', '	    		<div class="AdsImg-href-left">', '	    			<ul class="VBox">', '	    				<li class="Bflex1"><a href="' + _this.GetAdsLink(adItems[0].linkType, adItems[0].link) + '" data-growing-title="' + advertItem.moduleName + 1 + '">' + '                           <img src="' + HTTP_IMAGE_URL + adItems[0].imageUrl + '" alt=""  data-growing-title="' + advertItem.moduleName + 0 + '"></a></li>', "	    			</ul>", "	    		</div>", '	    		<div class="AdsImg-href-right VBox Bflex1 ">', '	    			<ul class="VBox Bflex1">', '	    				<li class="Bflex1 HBox">', '	    					<div class="Bflex1 left_Box"><a href="' + _this.GetAdsLink(adItems[1].linkType, adItems[1].link) + '" data-growing-title="' + advertItem.moduleName + 1 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[1].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 1 + '"></a></div>', '	    					<div class="Bflex1 right_Box"><a href="' + _this.GetAdsLink(adItems[2].linkType, adItems[2].link) + '" data-growing-title="' + advertItem.moduleName + 2 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[2].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 2 + '"></a></div>', "	    				</li>", '	    				<li class="Bflex1 HBox">', '	    					<div class="Bflex1 left_Box"><a href="' + _this.GetAdsLink(adItems[3].linkType, adItems[3].link) + '" data-growing-title="' + advertItem.moduleName + 3 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[3].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 3 + '"></a></div>', '	    					<div class="Bflex1 right_Box"><a href="' + _this.GetAdsLink(adItems[4].linkType, adItems[4].link) + '" data-growing-title="' + advertItem.moduleName + 4 + '">' + '                               <img src="' + HTTP_IMAGE_URL + adItems[4].imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + 4 + '"></a></div>', "	    				</li>", "	    			</ul>", "	    		</div>", "	    	</div>", "	    </div>", "   </div>", "</section>" ].join("");
            } else {
                return;
            }
            var $advertHtml = $(advertHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $advertHtml.addClass("AdsInterval_gray");
            }
            var oSlidePageScroll = $(".js_slidePageScroll");
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($advertHtml);
            adItems = null;
            advertHtml = null;
        },
        // 水平滚动产品
        GoodsHScroll: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            var boxHtml = '<div class="AdsImgShow goods_HScroll js_goods_HScroll">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="swiper-container goodsBox_HScroll js_HScroll ">' + '           <div class="swrap-HScroll swiper-wrapper goodsList js_goodsListScroll" >' + "           </div>" + "       </div>" + "   </div>" + "</div>";
            var $htmlBox = $(boxHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $htmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($htmlBox);
            var $goodsList = $htmlBox.find(".js_goodsListScroll");
            /*
             * 使用接口给的新数据
            */
            var data = advertItem.groupGoodsVoList;
            var goodsHtml = "";
            if (data == null || data.length <= 0) {
                return;
            }
            for (var idx = 0; idx < data.length; idx++) {
                var item = data[idx];
                // 全额保障  选择性显示哪些右上角图标
                var firstGueeImagePath = item.firstGueeImagePath;
                var html_firstGueeImagePath = "";
                if (firstGueeImagePath != null && firstGueeImagePath != "") {
                    var gueeUrl = firstGueeImagePath;
                    html_firstGueeImagePath = '<div class="quanpei"><img src="' + gueeUrl + '" alt=""  /></div>';
                }
                // 新品 直降 左上角标记
                var html_goodsLabels = "";
                if (item.goodsLabels && item.goodsLabels != "") {
                    html_goodsLabels = '<div class="verpromotionHot">' + "   <span>" + item.goodsLabel + "</span>" + '   <div><img src="' + BASE_URL + '/static_v4/image/iconImg/hotIcon.png" alt=""></div>' + "</div>";
                }
                // 好吃 直降 底部提示
                var html_label = "";
                if (item.label && item.label != "") {
                    html_label += '<p class="promotionSale">';
                    for (var i = 0; i < item.labels.length; i++) {
                        html_label += "<i>" + item.labels[i] + "</i>";
                    }
                    html_label += "</p>";
                }
                goodsHtml += '<div class="slide-HScroll swiper-slide">' + '   <a href="' + BASE_URL + "/h/goodspay/goodsView/" + item.goodsSn + '" data-growing-title="' + item.name + '" requestId="' + item.requestId + '" goodsid="' + item.id + '">' + "       <figure>" + '           <img class="swiper-lazy" data-src="' + HTTP_IMAGE_URL + item.showImage + smallImgArg300 + '" src="' + BASE_URL + '/static_v4/image/loadImg.jpg" data-growing-title="' + item.name + '">' + html_firstGueeImagePath + html_goodsLabels + "       </figure>" + '       <aside class="priceArea VBox Bflex1">' + '           <div class="Bflex1 priceArea_name">' + "               <h4>" + item.name + "</h4>" + '               <div class="smallFont_tip">' + item.title + "</div>" + "               </div>" + '           <div class="priceArea_price">' + '               <div class="HBox priceAreaBox">' + // '                <span class="goodsPriceOld">￥29.00</span>' +
                '                   <span class="goodsPrice">￥' + item.salePrice + "</span>" + "               </div>" + "           </div>" + html_label + "       </aside>" + "   </a>" + "</div>";
            }
            $goodsList.append(goodsHtml);
            adsInit.SetAdsLiScroll($htmlBox, iNow);
            boxHtml = null;
            goodsHtml = null;
            item = null;
            // 插入产品标题
            $goodsList.parents(".js_AdsImgMain").prepend(_this.TitleHtml(adItems[0].moduleTitle, adItems[0].timerType));
            adsInit.CutDataTime();
        },
        // 水平滚动产品----拼单--增加查看更多
        GoodsHScrollMore: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            var boxHtml = '<div class="AdsImgShow goods_HScroll js_goods_HScroll">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="swiper-container goodsBox_HScroll js_HScroll ">' + '           <div class="swrap-HScroll swiper-wrapper goodsList js_goodsListScroll" >' + "           </div>" + "       </div>" + "   </div>" + "</div>";
            var $htmlBox = $(boxHtml);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $htmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($htmlBox);
            var $goodsList = $htmlBox.find(".js_goodsListScroll");
            /*
             * 使用接口给的新数据

            var datas = advertItem.groupGoodsVoList;
            var goodsHtml = '';
            if(datas == null || datas.length <=0){
                return;
            }
            for (var idx = 0; idx < datas.length; idx ++){
                var item = datas[idx];
                // 全额保障  选择性显示哪些右上角图标
                var firstGueeImagePath=item.firstGueeImagePath;
                var html_firstGueeImagePath = '';
                if(firstGueeImagePath!=null && firstGueeImagePath!="") {
                    var gueeUrl=firstGueeImagePath;
                    html_firstGueeImagePath = '<div class="eightcount"><img src="'+gueeUrl+'" alt="" /></div>';
                }

                // 新品 直降 左上角标记
                var html_goodsLabels = '';
                if(item.goodsLabels && item.goodsLabels != '') {
                    html_goodsLabels =
                        '<div class="verpromotionHot">' +
                        '   <span>'+ item.goodsLabel +'</span>' +
                        '   <div><img src="' + BASE_URL + '/static_v4/image/iconImg/hotIcon.png" alt=""></div>' +
                        '</div>';
                }

                // 好吃 直降 底部提示
                var html_label = '';
                if(item.label && item.label != ''){
                    html_label += '<p class="promotionSale">';
                    for(var i=0;i<item.labels.length;i++){
                        html_label += '<i>'+item.labels[i]+'</i>'
                    }
                    html_label += '</p>';
                }


                goodsHtml += '' +
                    '<div class="slide-HScroll swiper-slide">' +
                    '   <a href="' + BASE_URL + '/h/goodspay/goodsView/' + item.goodsSn + '" data-growing-title="'+item.name+'">' +
                    '       <figure class="pintuan_radius">' +
                    '           <img class="swiper-lazy" data-src="' + HTTP_IMAGE_URL + item.showImage + smallImgArg300 +'" src="' + BASE_URL + '/static_v4/image/loadImg.jpg" data-growing-title="'+item.name+'">' +
                    html_firstGueeImagePath +
                    html_goodsLabels +
                    '       </figure>' +
                    '       <aside class="priceArea VBox Bflex1 collageArea pindanArea">' +
                    '           <div class="Bflex1 priceArea_name">' +
                    '               <h4>' + item.name + '</h4>' +
                    '               <div class="smallFont_tip">' + item.title + '</div>' +
                    '           </div>' +
                    '           <div class="priceArea_price">' +
                    '               <div class="HBox priceAreaBox">' +
                    '                   <span class="goodsPrice">￥' + item.tuangouPrices + '</span>' +
                    '                   <span class="goodsPriceOld goodSalePrice">￥' + item.salePrice + '</span>' +
                    '               </div>' +
                    '           </div>' +
                    html_label +
                    '       </aside>' +
                    '   </a>' +
                    '</div>';
            }
            $goodsList.append(goodsHtml);
            adsInit.SetAdsLiScroll( $htmlBox, iNow );
            boxHtml = null;
            goodsHtml = null;
            item = null;

            // 插入产品标题
            $goodsList.parents('.js_AdsImgMain').prepend(_this.TitleMoreHtml(adItems[0].moduleTitle, adItems[0].timerType,adItems[0].viewMoreUrl));
            adsInit.CutDataTime();
            */
            /*
            隐藏以前请求数据操作
            */
            var goodsGroupUrl = BASE_URL + adItems[0].tuangouGoodsUrl;
            var data = {
                groupName: adItems[0].goodsGroupName,
                start: 0,
                limit: 20
            };
            G_JSON_GET(goodsGroupUrl, data, function(data) {
                var datas = data.result;
                var goodsHtml = "";
                if (datas.length <= 0) {
                    return;
                }
                for (var idx = 0; idx < datas.length; idx++) {
                    var item = datas[idx];
                    // 全额保障  选择性显示哪些右上角图标
                    var firstGueeImagePath = item.firstGueeImagePath;
                    var html_firstGueeImagePath = "";
                    if (firstGueeImagePath != null && firstGueeImagePath != "") {
                        var gueeUrl = firstGueeImagePath;
                        html_firstGueeImagePath = '<div class="eightcount"><img src="' + gueeUrl + '" alt="" /></div>';
                    }
                    // 新品 直降 左上角标记
                    var html_goodsLabels = "";
                    if (item.goodsLabels && item.goodsLabels != "") {
                        html_goodsLabels = '<div class="verpromotionHot">' + "<span>" + item.goodsLabel + "</span>" + '<div><img src="' + BASE_URL + '/static_v4/image/iconImg/hotIcon.png" alt=""></div>' + "</div>";
                    }
                    // 好吃 直降 底部提示
                    var html_label = "";
                    if (item.label && item.label != "") {
                        html_label += '<p class="promotionSale">';
                        for (var i = 0; i < item.labels.length; i++) {
                            html_label += "<i>" + item.labels[i] + "</i>";
                        }
                        html_label += "</p>";
                    }
                    goodsHtml += "" + '<div class="slide-HScroll swiper-slide">' + '   <a href="' + BASE_URL + "/h/goodspay/goodsView/" + item.goodsSn + '" data-growing-title="' + item.name + '" requestId="' + item.requestId + '" goodsid="' + item.id + '">' + '       <figure class="pintuan_radius">' + '           <img class="swiper-lazy" data-src="' + HTTP_IMAGE_URL + item.showImage + smallImgArg300 + '" src="' + BASE_URL + '/static_v4/image/loadImg.jpg" data-growing-title="' + item.name + '">' + html_firstGueeImagePath + html_goodsLabels + "       </figure>" + '       <aside class="priceArea VBox Bflex1 collageArea pindanArea">' + '           <div class="Bflex1 priceArea_name">' + "               <h4>" + item.name + "</h4>" + '               <div class="smallFont_tip">' + item.title + "</div>" + "           </div>" + '           <div class="priceArea_price">' + '               <div class="HBox priceAreaBox">' + '                   <span class="goodsPrice">￥' + item.tuangouPrices + "</span>" + '                   <span class="goodsPriceOld goodSalePrice">￥' + item.salePrice + "</span>" + "               </div>" + "           </div>" + html_label + "       </aside>" + "   </a>" + "</div>";
                }
                $goodsList.append(goodsHtml);
                adsInit.SetAdsLiScroll($htmlBox, iNow);
                boxHtml = null;
                goodsHtml = null;
                item = null;
            }, function() {}, function() {
                $goodsList.parents(".js_AdsImgMain").prepend(_this.TitleMoreHtml(adItems[0].moduleTitle, adItems[0].timerType, adItems[0].viewMoreUrl));
                adsInit.CutDataTime();
            });
        },
        // 广告图+商品滚动
        AdsAndScroll: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            if (adItems.length != 1) {
                return;
            }
            var item = adItems[0];
            var cLink = _this.GetAdsLink(item.linkType, item.link);
            var adsImg = '<section class="AdsImgShow AdsImgShow AdsImgShowBannerScroll js_AdsImgShowBannerScroll">' + '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>' + '   <div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">' + '       <div class="AdsImgShowBox">' + '           <div class="AdsImgShowBanner HBox BoxCenter">' + '               <div class="Ads-bannerList Bflex1">' + "                   <ul>" + '                       <li><a href="' + cLink + '" data-growing-title="' + advertItem.moduleName + '" requestId="' + advertItem.requestId + '" goodsid="' + advertItem.id + '"><img src="' + HTTP_IMAGE_URL + item.imageUrl + '" alt="" data-growing-title="' + advertItem.moduleName + '"></a></li>' + "                   </ul>" + "               </div>" + "           </div>" + "       </div>" + "   </div>" + "</section>";
            var goodsScrollBox = '<div class="goods_HScroll goods_HScroll-sm js_goods_HScroll">' + '   <div class="swiper-container goodsBox_HScroll js_HScroll ">' + '   <div class="swrap-HScroll swiper-wrapper goodsList" >' + "   </div>" + "   </div>" + "</div>";
            var $scrollBox = $(goodsScrollBox);
            var $adsImg = $(adsImg);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $adsImg.addClass("AdsInterval_gray");
            }
            $adsImg.find(".js_AdsImgMain").append($scrollBox);
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($adsImg);
            adsImg = null;
            goodsScrollBox = null;
            var $goodsList = $scrollBox.find(".goodsList");
            /*
           * 使用接口给的新数据
           */
            var data = advertItem.groupGoodsVoList;
            if (data == null || data.length <= 0) {
                return;
            }
            for (var idx = 0; idx < data.length; idx++) {
                var item = data[idx];
                // 全额保障  选择性显示哪些右上角图标
                var firstGueeImagePath = item.firstGueeImagePath;
                var html_firstGueeImagePath = "";
                if (firstGueeImagePath != null && firstGueeImagePath != "") {
                    var gueeUrl = firstGueeImagePath;
                    html_firstGueeImagePath = '<div class="quanpei"><img src="' + gueeUrl + '" alt="" /></div>';
                }
                // 新品 直降 左上角标记
                var html_goodsLabels = "";
                if (item.goodsLabels && item.goodsLabels != "") {
                    html_goodsLabels = '<div class="verpromotionHot">' + "   <span>" + item.goodsLabel + "</span>" + '   <div><img src="' + BASE_URL + '/static_v4/image/iconImg/hotIcon.png" alt=""></div>' + "</div>";
                }
                // 好吃 直降 底部提示
                var html_label = "";
                if (item.label && item.label != "") {
                    html_label += '<p class="promotionSale">';
                    for (var i = 0; i < item.labels.length; i++) {
                        html_label += "<i>" + item.labels[i] + "</i>";
                    }
                    html_label += "</p>";
                }
                var goodsHtml = '<div class="slide-HScroll swiper-slide">' + '   <a href="' + BASE_URL + "/h/goodspay/goodsView/" + item.goodsSn + '" data-growing-title="' + item.name + '" requestId="' + item.requestId + '" goodsid="' + item.id + '">' + "       <figure>" + '           <img class="swiper-lazy" data-src="' + HTTP_IMAGE_URL + item.showImage + smallImgArg300 + '" src="' + BASE_URL + '/static_v4/image/loadImg.jpg"  data-growing-title="' + item.name + '">' + html_firstGueeImagePath + html_goodsLabels + "       </figure>" + '       <aside class="priceArea VBox Bflex1">' + '           <div class="Bflex1 priceArea_name">' + "               <h4>" + item.name + "</h4>" + '               <div class="smallFont_tip">' + item.title + "</div>" + "           </div>" + '           <div class="priceArea_price">' + '               <div class="HBox priceAreaBox">' + // '                <span class="goodsPriceOld">￥29.00</span>' +
                '                   <span class="goodsPrice">￥' + item.salePrice + "</span>" + "               </div>" + "           </div>" + html_label + "       </aside>" + "   </a>" + "</div>";
                $goodsList.append(goodsHtml);
                goodsHtml = null;
                item = null;
            }
            adsInit.SetAdsLiScroll($adsImg, iNow);
        },
        // 商品旋转滚动轮播
        AdsGoodsBanner: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            if (adItems.length != 1) {
                return;
            }
            var item = adItems[0];
            var title = item.moduleTitle;
            var goodsGroupName = item.goodsGroupName;
            var htmlBox = [ '<section class="AdsImgShow AdsHRotateBox js_AdsHRotateBox">', '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>', '	<div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">', '	    <div class="goods_title HBox BoxCenter">', '	    	<div class="title_line"></div>', '	    	<div class="title_name">' + title + "</div>", '	    	<div class="title_line"></div>', "	    </div>", '	    <div class="swiper-container AdsHRotateSwiper js_HRotate">', '	    	<div class=" swiper-wrapper goodsList" >', "	    	</div>", '	    	<div class="swiper-pagination js_pagin "></div>', "	    </div>", "	</div>", "</section>" ].join("");
            var $htmlBox = $(htmlBox);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $htmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($htmlBox);
            var $goodsList = $htmlBox.find(".goodsList");
            /*
            * 使用接口给的新数据
            */
            var data = advertItem.groupGoodsVoList;
            if (data == null || data.length <= 0) {
                return;
            }
            for (var idx = 0; idx < data.length; idx++) {
                var item = data[idx];
                var salePrice = item.salePrice;
                var priceInt = parseInt(salePrice);
                var priceFloat = parseInt((salePrice - priceInt) * 10);
                if (priceFloat == 0) {
                    priceFloat = "";
                } else {
                    priceFloat = "." + priceFloat;
                }
                var goodsHtml = [ '<div class="swiper-slide goodsList-slide">', '	<a swiper_href="' + BASE_URL + "/h/goodspay/goodsView/" + item.goodsSn + '" data-growing-title="' + item.name + '" requestId="' + item.requestId + '" goodsid="' + item.id + '">', "		<figure>", '			<img  src="' + HTTP_IMAGE_URL + item.showImage + smallImgArg300 + '"  data-growing-title="' + item.name + '">', "		</figure>", '		<aside class="priceArea Bflex1">', '			<div class="Bflex1 priceArea_name">', "				<h4>" + item.name + "</h4>", '				<p class="smallFont_tip">' + item.title + "</p>", "			</div>", '			<div class="priceArea_price priceAreaAbs_price">', '				<p class="priceAreaBox">', '					<span class="goodsPrice"><i>￥</i>' + priceInt + "<i>" + priceFloat + "</i></span>", '					<span class="splitline"></span>', '					<span class="topNum">', "					<i>-</i><i>Top" + (idx + 1) + "</i><i>-</i>", "				</span>", "				</p>", "			</div>", "		</aside>", "	</a>", "</div>" ].join("");
                $goodsList.append(goodsHtml);
                goodsHtml = null;
                item = null;
            }
            adsInit.SetAdsRotate(stretchs, $htmlBox, iNow);
        },
        // 图片滚动轮播
        AdsPicBanner: function(advertItem, iNow) {
            var _this = this;
            var oSlidePageScroll = $(".js_slidePageScroll");
            var adItems = JSON.parse(advertItem.items);
            var picBannerList = "";
            for (var i = 0; i < adItems.length; i++) {
                var item = adItems[i];
                var cLink = _this.GetAdsLink(item.linkType, item.link);
                picBannerList += [ '<div class="swiper-slide ">', '	<a swiper_href="' + cLink + '" data-growing-title="' + advertItem.moduleName + i + '" requestId="' + advertItem.requestId + '" goodsid="' + advertItem.id + '">', "		<figure>", '			<img  src="' + HTTP_IMAGE_URL + item.imageUrl + '"  data-growing-title="' + advertItem.moduleName + i + '">', "		</figure>", "	</a>", "</div>" ].join("");
            }
            var htmlBox = [ '<section class="AdsImgShow AdsLong_HScrollBox js_AdsLong_HScrollBox">', '   <div class="ads-white-interval" style="background-color: #' + advertItem.topIntervalColor + '"></div>', '	<div class="AdsImgMain js_AdsImgMain" style="background-color: #' + advertItem.backgroundColor + '">', '		<div class="swiper-container AdsLong_HScrollSwiper js_AdsLong_HScrollSwiper">', '			<div class="swiper-wrapper longSwiper" >', picBannerList, "			</div>", "		</div>", "	</div>", "</section>" ].join("");
            var $htmlBox = $(htmlBox);
            if (advertItem.spacing != null && advertItem.spacing == 1) {
                $htmlBox.addClass("AdsInterval_gray");
            }
            oSlidePageScroll.eq(iNow).find(".jsAdvert").append($htmlBox);
            adsInit.SetAdsLongSwiper(stretchLong, $htmlBox, iNow);
            htmlBox = null;
            picBannerList = null;
        },
        GetAdsLink: function(linkType, link) {
            if (linkType == undefined || link == undefined) {
                return BASE_URL;
            }
            switch (linkType) {
              case "CUSTOM_LINK":
                return link;
                break;

              case "H5_LINK":
                return link;
                break;

              case "APP_LINK":
                return BASE_URL;
                break;

              case "GOODS_LINK":
                return BASE_URL + "/h/goodspay/goodsView/" + link;
                break;

              default:
                return BASE_URL;
                break;
            }
        },
        // 产品标题
        TitleHtml: function(title, timerType) {
            if (title == undefined || title.length <= 0) {
                return "";
            }
            var timer = "";
            if (timerType != undefined) {
                if (timerType == "DAY_TIMER") {
                    timer = '<div class="act-timeShow Bflex1">' + '   <span class="timeShow timeBg-black"></span><i>/</i>' + '   <span class="timeShow timeBg-black"></span><i>/</i>' + '   <span class="timeShow timeBg-red"></span>' + "</div>";
                }
            }
            // 标题信息
            var stitleTipText = '<div class="goods_title HBox">' + "   <h5><span>" + title + "</span>" + "   </h5>" + "   " + timer + "" + "</div>";
            return stitleTipText;
        },
        // 产品标题增加拼单商品与查看更多链接
        TitleMoreHtml: function(title, timerType, moreUrl) {
            if (title == undefined || title.length <= 0) {
                return "";
            }
            var timer = "";
            if (timerType != undefined) {
                if (timerType == "DAY_TIMER") {
                    timer = '<div class="act-timeShow Bflex1">' + '<span class="timeShow timeBg-black"></span><i>/</i>' + '<span class="timeShow timeBg-black"></span><i>/</i>' + '<span class="timeShow timeBg-red"></span></div>';
                }
            }
            // 标题信息
            var stitleTipText = '<div class="goods_title HBox">' + "   <h5><span>" + title + "</span></h5>" + "   " + timer + '   <a class="index_addMore" href="' + moreUrl + '"><span>查看更多</span><i class="iconStyle icon-href-right"></i></a>' + "</div>";
            return stitleTipText;
        }
    };
    exports.adsHtml = adsHtml;
    var adsAjax = {
        pageIndex: 0,
        loadAdsCount: 0,
        // 加载计数
        categoryNames: [],
        // 广告模块名称
        lockScroll: function() {
            var _this = this;
            _this.loadAdsCount++;
        },
        unlockScroll: function(fn) {
            var _this = this;
            _this.loadAdsCount--;
            if (_this.loadAdsCount == 0) {
                if (fn) fn();
            }
        },
        // 设置广告数据
        AdsAjaxData: function(index, categoryNames, fn) {
            var _this = this;
            _this.categoryNames = categoryNames;
            _this.pageIndex = index;
            var advertUrl = BASE_URL + "/moduleAdvert/getShowAdvert";
            var data = {};
            if (index != 0) {
                data = {
                    sceneName: categoryNames[index - 1]
                };
            } else {
                if (typeof HOME_SCENE != "undefined") {
                    data = {
                        sceneName: HOME_SCENE
                    };
                }
            }
            var _data = null;
            G_JSON_POST(advertUrl, data, function(data) {
                _data = data;
                if (data.length <= 0) {
                    if (fn) fn();
                    return;
                }
                for (var idx = 0; idx < data.length; idx++) {
                    var advertItem = data[idx];
                    switch (advertItem.moduleType) {
                      case "NAVIGATION":
                        adsHtml.AdsHorizontal(advertItem, index);
                        break;

                      case "NAVIGATION_MIN":
                        adsHtml.AdsHorizontalMin(advertItem, index);
                        break;

                      case "SHOPWINDOW":
                        adsHtml.AdsGroup3(advertItem, index);
                        break;

                      case "DOUBLEGOODS":
                        adsHtml.AdsGroup2(advertItem, index);
                        break;

                      case "GOODSSCROLL":
                        adsHtml.GoodsHScroll(advertItem, index);
                        break;

                      case "SINGLEGOODS":
                        adsHtml.AdsBanner(advertItem, index);
                        break;

                      case "GOODSGROUP":
                        adsHtml.AdsAndScroll(advertItem, index);
                        break;

                      case "HEADLINE":
                        adsHtml.AdsHeadline(advertItem, index);
                        break;

                      case "ONEFOURADVERT":
                        adsHtml.AdsOneFour(advertItem, index);
                        break;

                      case "BANNER_TYPE_1":
                        adsHtml.AdsGoodsBanner(advertItem, index);
                        break;

                      case "BANNER_TYPE_2":
                        adsHtml.AdsPicBanner(advertItem, index);
                        break;

                      case "TUANGOU":
                        adsHtml.GoodsHScrollMore(advertItem, index);
                        break;

                      // case "BANNER_TYPE_2" :
                        //     adsHtml.AdsHorizontalScroll(advertItem, index);
                        //     break;
                        default:
                        console.error("暂不支持的广告类型 " + advertItem.moduleType);
                        break;
                    }
                }
                if (fn) fn();
            }, function() {}, function() {
                // end
                if (_data == null) {
                    if (fn) fn();
                }
            });
        },
        AdsAjaxDataForRegion: function(index, categoryNames, fn) {
            var _this = this;
            var advertUrl = BASE_URL + "/moduleAdvert/getShowRegionAdvert";
            var data = {};
            data = {
                sceneName: categoryNames
            };
            G_JSON_POST(advertUrl, data, function(data) {
                if (data.length <= 0) {
                    return;
                }
                $(".swiper-wrapper").remove();
                for (var idx = 0; idx < data.length; idx++) {
                    var advertItem = data[idx];
                    switch (advertItem.moduleType) {
                      case "NAVIGATION":
                        adsHtml.AdsHorizontal(advertItem, index);
                        break;

                      case "NAVIGATION_MIN":
                        adsHtml.AdsHorizontalMin(advertItem, index);
                        break;

                      case "SHOPWINDOW":
                        adsHtml.AdsGroup3(advertItem, index);
                        break;

                      case "DOUBLEGOODS":
                        adsHtml.AdsGroup2(advertItem, index);
                        break;

                      case "GOODSSCROLL":
                        adsHtml.GoodsHScroll(advertItem, index);
                        break;

                      case "SINGLEGOODS":
                        adsHtml.AdsBanner(advertItem, index);
                        break;

                      case "GOODSGROUP":
                        adsHtml.AdsAndScroll(advertItem, index);
                        break;

                      case "HEADLINE":
                        adsHtml.AdsHeadline(advertItem, index);
                        break;

                      case "ONEFOURADVERT":
                        adsHtml.AdsOneFour(advertItem, index);
                        break;

                      case "BANNER_TYPE_1":
                        adsHtml.AdsGoodsBanner(advertItem, index);
                        break;

                      case "BANNER_TYPE_2":
                        adsHtml.AdsPicBanner(advertItem, index);
                        break;

                      case "TUANGOU":
                        adsHtml.GoodsHScrollMore(advertItem, index);
                        break;

                      // case "BANNER_TYPE_2" :
                        //     adsHtml.AdsHorizontalScroll(advertItem, index);
                        //     break;
                        default:
                        console.error("暂不支持的广告类型 " + advertItem.moduleType);
                        break;
                    }
                }
                if (fn) fn();
            }, function() {}, function() {});
        },
        // 广告数据
        getPop: function() {
            // if(myPub.getCookie('adsLayer') == null) {
            //    G_JSON_GET('/popAdv/getPop',null,function (response) {
            //         try {
            //             var link = response.link, popImage = response.popImage;
            //             if (link != '' && popImage != '') {
            //                 $('#popImage').attr('src', HTTP_IMAGE_URL + popImage)
            //                 $('#popLink').attr('href', link);
            //                 $('.layer_Ads').show();
            //                 myPub.setCookie('adsLayer',true, 's'+adsInit.cutTimeToday());
            //             }
            //         } catch (e) { }
            //     })
            // }
            G_JSON_GET("/popAdv/getPop4", null, function(response) {
                try {
                    if (response != null && response != "") {
                        var popAdvMemoryOpt = response.popAdvMemoryOpt;
                        var popImage = response.popImage;
                        var link = response.link;
                        var popId = response.popId;
                        if (popAdvMemoryOpt == "SHOW_ONCE" || popAdvMemoryOpt == "ONCE_DAY_SHOW") {
                            if (myPub.getCookie("adsLayer" + popId) == null) {
                                $("#popImage").attr("src", HTTP_IMAGE_URL + popImage);
                                $("#popLink").attr("href", link);
                                $(".layer_Ads").show();
                                myPub.setCookie("adsLayer" + popId, true, "s" + response.popAdvCookieRemainSecond);
                            }
                        } else {
                            $("#popImage").attr("src", HTTP_IMAGE_URL + popImage);
                            $("#popLink").attr("href", link);
                            $(".layer_Ads").show();
                        }
                    }
                } catch (e) {}
            });
        }
    };
    exports.adsAjax = adsAjax;
    // 用户行为
    var ddjAction = {
        viewGoods: function(obj, iNow) {
            var ddjActionPositionId = {};
            ddjActionPositionId.positionFirst = "首页";
            if (iNow > 0) {
                ddjActionPositionId.positionId = 2;
                // ddjActionPositionId.positionType = '首页-' + adsAjax.categoryNames[iNow-1];
                ddjActionPositionId.positionSecond = adsAjax.categoryNames[iNow - 1];
            } else {
                ddjActionPositionId.positionId = 1;
                // ddjActionPositionId.positionType = '首页-推荐';
                ddjActionPositionId.positionSecond = "推荐";
            }
            // 统计曝光数据
            visualArea.viewEl.showViewEls(obj, function(data, dataJson) {
                ddjhoc.setData(data, "rec_show", "add", function() {
                    // console.log('ddjhoc.params.rec_show.adsMod', ddjhoc.params);
                    if (ddjhoc.params.length != 0) ddjhoc.sendData(ddjhoc.params);
                    console.log("ddjhoc.ddjParams.rec_show.adsMod", ddjhoc.ddjParams);
                    if (ddjhoc.ddjParams.length != 0) ddjhoc.sendDDJData(ddjhoc.ddjParams);
                }, dataJson, ddjActionPositionId);
            });
        }
    };
});
define("static_v4/js/mod/swiperAds", [ "./visualAreaInfo" ], function(require, exports, module) {
    // 曝光可视区域元素
    var visualArea = require("./visualAreaInfo");
    //广告轮播
    var oSilderImg = $(".js_silderImg");
    //广告轮播框
    var oPagin = $(".js_pagin");
    //个数点
    var indexSwiperAD = [];
    var locationHref = window.location.href;
    var LoopOff = true;
    var ddjAction = "";
    var ddjActionOff = true;
    var ddjActionPositionId = {};
    // 判断是物品详情时 做处理
    if (locationHref.indexOf("h/goodspay/goodsView") > 1) {
        LoopOff = false;
        ddjActionPositionId.positionId = 2;
    }
    /*----2018-4-13-lou添加------*/
    var resizeTimer = null;
    var oWindow = $(window);
    Swiper_indexAD();
    // 页面尺寸修改
    oWindow.on("resize", function() {
        if (resizeTimer) {
            clearTimeout(resizeTimer);
        }
        resizeTimer = setTimeout(function() {
            Swiper_indexAD();
        }, 400);
    });
    function Swiper_indexAD() {
        oSilderImg.each(function(i) {
            // 设置滚动条展示位置 1 为首页
            if (oSilderImg.eq(i).parents(".js_slidePageWrap").length > 0) {
                ddjActionPositionId.positionId = 1;
                // ddjActionPositionId.positionType = '首页-推荐';
                ddjActionPositionId.positionFirst = "首页";
                ddjActionPositionId.positionSecond = "推荐";
            }
            if (indexSwiperAD[i] == undefined || indexSwiperAD[i] === "") {
                if (oSilderImg.eq(i).find(".swiper-slide").length < 2) {} else {
                    indexSwiperAD = oSilderImg.eq(i).swiper({
                        pagination: oPagin.eq(i),
                        loop: LoopOff,
                        autoplay: 3e3,
                        autoplayDisableOnInteraction: false,
                        onSlideChangeEnd: function(swiper) {
                            var index = swiper.activeIndex;
                            var _iNow = 0;
                            if (LoopOff) _iNow = 1;
                            if (index > _iNow && ddjActionOff) {
                                ddjAction.viewGoods(oSilderImg.eq(i).find(".swiper-wrapper"));
                            }
                        },
                        onReachEnd: function() {
                            // console.log('最后一个了')
                            ddjActionOff = false;
                        }
                    });
                }
            } else {
                indexSwiperAD[i].onResize();
            }
        });
    }
    // 用户行为
    ddjAction = {
        viewGoods: function(obj) {
            // 统计曝光数据
            visualArea.viewEl.showViewEls(obj, function(data, dataJson) {
                ddjhoc.setData(data, "rec_show", "add", function() {
                    // console.log('ddjhoc.params.rec_show.swiperAds', ddjhoc.params);
                    if (ddjhoc.params.length != 0) ddjhoc.sendData(ddjhoc.params);
                    console.log("ddjhoc.ddjParams.rec_show.swiperAds", ddjhoc.ddjParams);
                    if (ddjhoc.ddjParams.length != 0) ddjhoc.sendDDJData(ddjhoc.ddjParams);
                }, dataJson, ddjActionPositionId);
            });
        }
    };
});
define("static_v4/js/mod/historyCookie", [ "./public", "../plug/base64" ], function(require, exports, module) {
    var myPub = require("./public");
    var base64 = require("../plug/base64");
    // 搜索设置cookie
    var cTime = "d7";
    // coookie 时间
    var _val = [];
    var oMessageIcon = $(".js_messageIcon");
    // 首页消息图标
    var oSearchBox = $(".js_searchBox");
    // 搜索区域
    var oSearchRecom = $(".js_searchRecom");
    // 搜索推荐
    var oSearchBtn = $(".js_searchBtn");
    // 搜索按钮
    var oSearchTxt = $(".js_searchTxt");
    // 搜索框
    var oHClearBtn = $(".js_HClearBtn");
    // 清楚历史记录按钮
    var oHisListUl = $(".js_hisList").find("ul");
    // 历史记录UL
    var recomHTMl = oHisListUl.html();
    // 系统推荐
    var cookArry = document.cookie.split("; ");
    // 分离cookie成数组
    var cookIndex = parseInt(myPub.getCookie("cookIndex"));
    // 记录个数
    var oShadow = $(".js_shadow");
    // 阴影
    var oHotList = $(".js_hotList");
    // 热门列表
    var oClearBtn = $(".js_clearBtn");
    // 清除按钮
    var oSearchForm = $("#searchForm");
    // 提交的表单
    var oMessageIconHrefBtn = $(".js_messageIconHrefBtn");
    // 弹层搜索按钮
    var oShowSearchBox = $(".js_showSearchBox");
    // 搜索图标按钮
    var maxCookieNum = 4;
    var oClearSearchAndCover = $(".js_clearSearchAndCover");
    // 搜索推荐信息
    var oSearchRecomBox = $(".js_searchRecomBox");
    // 搜索提示
    var oSearchHrefList = $(".js_searchHrefList");
    var jArgList = {
        suggestStr: "",
        // 'start': 1,
        limit: 10
    };
    //取消滑动 
    oSearchRecom.on("touchmove", function(e) {
        e.preventDefault();
    });
    oSearchTxt.on("input propertychange", function() {
        if (oSearchTxt.val() !== "") {
            oSearchRecomBox.hide();
            oSearchHrefList.show();
            jArgList.suggestStr = oSearchTxt.val();
            getSearchList(jArgList);
        } else {
            oSearchRecomBox.show();
            oSearchHrefList.hide();
        }
    });
    // 搜多推荐列表点击
    oSearchHrefList.hammer().on("tap", function(e) {
        var _tag = e.gesture.target;
        var target, tarTxt;
        _tag.nodeName.toLowerCase() == "li" ? target = $(_tag) : target = $(_tag).parents("li");
        tarTxt = target.text();
        if (!tarTxt) return; else {
            oSearchTxt.val(target.text());
            oClearBtn.show();
            JumpSearchPage("", false, false, target.text(), false);
        }
        myPub.HamstopPropaga();
        e.stopPropagation();
    });
    oSearchTxt.on("focus", function() {
        //oMessageIcon.hide();
        oSearchRecom.show();
        oShadow.show().css({
            top: oSearchBox.outerHeight(true)
        });
    });
    /*oSearchTxt.on('blur', function () {
        //oMessageIcon.show();
        oSearchRecom.hide();
        oShadow.hide().css({'top': 0});
    });*/
    // 弹层消息按钮点击跳转
    oMessageIconHrefBtn.hammer().on("tap", function() {
        var _href = oMessageIconHrefBtn.find("a").attr("href");
        myPub.locationHref(_href);
    });
    $("#form").submit(function() {
        return false;
    });
    // 搜索图标按钮点击
    oShowSearchBox.on("click", function(e) {
        oSearchRecom.show();
        oSearchTxt.focus();
        e.stopPropagation();
    });
    // 阴影关闭
    oShadow.on("click", function(e) {
        //失去焦点
        oSearchTxt.blur();
        oSearchRecom.hide();
        oShadow.hide();
        e.stopPropagation();
    });
    oClearSearchAndCover.on("click", function(e) {
        //失去焦点
        oSearchTxt.blur();
        oSearchRecom.hide();
        oShadow.hide();
        e.stopPropagation();
    });
    oClearBtn.hammer().on("tap", function(e) {
        oSearchRecomBox.show();
        oSearchHrefList.hide();
        myPub.HamstopPropaga();
        e.stopPropagation();
    });
    // // 获取cookie并设置历史记录
    // if (myPub.getCookie('cookIndex') == undefined || myPub.getCookie('cookIndex') == -1) {
    //     myPub.setCookie('cookIndex', '-1', cTime);
    //     cookIndex = parseInt(myPub.getCookie('cookIndex'));
    // }
    // else {
    //     oHisListUl.empty();
    //     for (var i = 0; i < cookArry.length; i++) {
    //         if (cookArry[i].charAt(0) == 'r') {
    //             _val[i] = cookArry[i].substring(cookArry[i].indexOf('=') + 1);
    //             oHisListUl.prepend('<li><span>' + unescape(_val[i]) + '</span></li>');
    //         }
    //     }
    // }
    // 获取cookie并设置历史记录
    var searchListBase64 = myPub.getCookie("searchList");
    if (searchListBase64 != null && searchListBase64 != "") {
        var searchList = JSON.parse(base64.decode(searchListBase64));
        var searchLength = searchList.slice(-5);
        // 历史搜索记录最新搜索的0~5个记录
        var maxNumber = Math.min(5, searchList.length);
        // 历时搜索记录里最多有5个
        for (var i = 0; i < maxNumber; i++) {
            var obj = searchLength[i];
            if (obj.isLink) {
                if (obj.isSign) oHisListUl.prepend('<li><span class="active" data-type="yes" data-id="' + obj.link + '">' + obj.word + "</span></li>"); else oHisListUl.prepend('<li><span data-type="yes" data-id="' + obj.link + '">' + obj.word + "</span></li>");
            } else {
                if (obj.isSign) oHisListUl.prepend('<li><span class="active">' + obj.word + "</span></li>"); else oHisListUl.prepend("<li><span>" + obj.word + "</span></li>");
            }
        }
    }
    // 搜索后添加cookie
    // oSearchBtn.hammer().on('tap', function () {
    //     JumpSearchPage();
    // });
    //键盘事件
    $(document).keydown(function(event) {
        if (event.keyCode == 13) {
            var keyword = $("#keyword");
            var isLink = keyword.attr("data-id");
            var h5link = keyword.attr("data-type");
            var searchWord = keyword.attr("placeholder");
            var input = keyword.val();
            var saveJson = {
                word: input,
                isLink: false,
                link: "../../shop/goods/tosearchv3?keyword=" + input,
                isSign: false
            };
            // 保存搜索历史到cookie
            if (input == "") {
                saveJson.word = searchWord;
                if (isLink == "true") {
                    saveJson.isLink = true;
                    saveJson.link = h5link;
                } else {
                    saveJson.link = "../../shop/goods/tosearchv3?keyword=" + searchWord;
                }
            }
            saveHistory(saveJson);
            userAction(keyword, saveJson.word);
            window.location.href = saveJson.link;
        }
    });
    // 清除cookie和历史记录
    oHClearBtn.hammer().on("tap", function() {
        //失去焦点
        oSearchTxt.blur();
        myPub.askLayer("亲！您确定要清除历史记录？", function() {
            // for (var i = 0; i < cookArry.length; i++) {
            //     myPub.delCookie('records' + i);
            // }
            // myPub.delCookie('cookIndex');
            // // 清楚cookie的记录 添加系统推荐的
            // oHisListUl.empty().html(recomHTMl);
            clearHistory();
            myPub.LayerCloseAll();
        }, function() {
            myPub.LayerCloseAll();
        }, "no");
    });
    //热门搜索点击
    oHotList.hammer().on("tap", function(e) {
        oSearchTxt.blur();
        var _tarTag = e.gesture.target;
        var target, tarTxt;
        _tarTag.nodeName.toLowerCase() == "li" ? target = $(_tarTag) : target = $(_tarTag).parents("li");
        tarTxt = target.find("span").text();
        if (!tarTxt) return; else {
            oSearchTxt.val(tarTxt);
            oClearBtn.show();
            var isLink = target.find("span").attr("data-type"), link = target.find("span").attr("data-id"), isActive = target.find("span").hasClass("active");
            JumpSearchPage("hotwords", isLink, link, tarTxt, isActive);
        }
        myPub.HamstopPropaga();
        e.stopPropagation();
    });
    // 历史记录搜索点击
    oHisListUl.hammer().on("tap", function(e) {
        oSearchTxt.blur();
        var _tarTag = e.gesture.target;
        var target, tarTxt;
        _tarTag.nodeName.toLowerCase() == "li" ? target = $(_tarTag) : target = $(_tarTag).parents("li");
        tarTxt = target.find("span").text();
        if (!tarTxt) return; else {
            oSearchTxt.val(tarTxt);
            oClearBtn.show();
            var isLink = target.find("span").attr("data-type"), link = target.find("span").attr("data-id"), isActive = target.find("span").hasClass("active");
            JumpSearchPage("", isLink, link, tarTxt, isActive);
        }
        myPub.HamstopPropaga();
        e.stopPropagation();
    });
    // 跳转搜索结果
    function JumpSearchPage(searchType, isLink, link, text, isActive) {
        var keyword = $("#keyword");
        // if (oSearchTxt.val() == '') {
        //     //myPub.TipLayer('亲！搜索信息不能为空！');
        //     /oSearchFormSub();
        // }
        // else if (oSearchTxt.val().indexOf('<') > 0 || oSearchTxt.val().indexOf('>') > 0) {
        //     return
        // }
        // 检测是否有相同的产品
        // for (var i = 0; i < maxCookieNum; i++) {
        //     if (oSearchTxt.val() == myPub.getCookie('records' + i)) {
        //         //console.log('有相同名字')
        //         oSearchFormSub();
        //         return;
        //     }
        //
        // }
        // cookIndex == null || cookIndex >= maxCookieNum ? cookIndex = 0 : cookIndex++;
        // myPub.setCookie('records' + cookIndex, oSearchTxt.val(), cTime);
        // myPub.setCookie('cookIndex', cookIndex, cTime);
        var saveJson = {
            word: text,
            isLink: false,
            link: "../../shop/goods/tosearchv3?keyword=" + text,
            isSign: isActive
        };
        if (isLink == "yes") {
            saveJson.isLink = true;
            saveJson.link = link;
        }
        saveHistory(saveJson);
        userAction(keyword, saveJson.word);
        window.location.href = saveJson.link;
    }
    //延迟提交
    function oSearchFormSub() {
        var subTime;
        clearTimeout(subTime);
        subTime = setTimeout(function() {
            oSearchForm.submit();
        }, 300);
    }
    function saveHistory(obj) {
        var searchListBase64 = myPub.getCookie("searchList"), searchList = [], finalList = [];
        if (searchListBase64 == null || searchListBase64 == "") searchList = []; else searchList = JSON.parse(base64.decode(searchListBase64));
        var isContain = false;
        for (var i = 0; i < searchList.length; i++) {
            if (searchList[i].word == obj.word) isContain = true;
        }
        if (isContain) return;
        searchList.push(obj);
        var jsonListBase64 = base64.encode(JSON.stringify(searchList));
        myPub.setCookie("searchList", jsonListBase64);
    }
    function clearHistory() {
        myPub.setCookie("searchList", "");
        oHisListUl.html("");
    }
    // 获取关键字
    function getSearchWord() {
        G_JSON_GET("/search/searchWord", "", function(response) {
            try {
                if (response.status == 200) {
                    $("#keyword").attr("placeholder", response.searchWord.name);
                    $("#keyword").attr("data-id", response.searchWord.searchType);
                    $("#keyword").attr("data-type", response.searchWord.h5link);
                }
            } catch (e) {}
        });
    }
    // 获取热门搜索数据
    function getHotWords() {
        G_JSON_GET("/search/hotWords", null, function(response) {
            try {
                if (response.length > 0) {
                    var list = response;
                    for (var i = 0; i < list.length; i++) {
                        var name = list[i].name, isSign = list[i].isSign, searchType = list[i].searchType, h5link = list[i].h5link;
                        if (isSign) {
                            if (searchType) $(".js_hotList").append('<li><span class="active" data-type="yes" data-id="' + h5link + '">' + name + "</span></li>"); else $(".js_hotList").append('<li><span class="active" data-type="no">' + name + "</span></li>");
                        } else {
                            if (searchType) $(".js_hotList").append('<li><span data-type="yes" data-id="' + h5link + '">' + name + "</span></li>"); else $(".js_hotList").append('<li><span data-type="no">' + name + "</span></li>");
                        }
                    }
                }
            } catch (e) {}
        });
    }
    // 获取搜索推荐
    function getSearchList(arg) {
        G_JSON_GET("/openSearch/doSuggest", arg, function(response) {
            var Data = JSON.parse(response.suggests);
            var _listUl = oSearchHrefList.find("ul");
            _listUl.html("");
            for (var i = 0; i < Data.length; i++) {
                _listUl.append("<li>" + Data[i].suggestion + "</li>");
            }
            if (Data.length == 0) {
                oSearchRecomBox.show();
                oSearchHrefList.hide();
            }
        });
    }
    // 添加用户行为
    function userAction(obj, keyword) {
        ddjhoc.setData(obj, "search", "add", function() {
            console.log("params.search", ddjhoc.params);
            ddjhoc.sendData(ddjhoc.params);
        }, keyword);
    }
    getHotWords();
    getSearchWord();
});
define("static_v4/js/mod/webcall_message", [], function(require, exports, module) {
    var webcallMsgDiv = $(".js_webcallMsg");
    $(function() {
        // 动态获取是否有新的消息
        $.ajax({
            url: "/365webcall/messageCount",
            type: "GET",
            dataType: "json",
            success: function(data) {
                if (data == true || data == "true") {
                    webcallMsgDiv.find("i").addClass("active");
                }
            },
            complete: function(XHR, TS) {
                XHR = null;
            }
        });
    });
});
/**
 * 快捷加入购物车 ---- 商品推荐右下角快捷加入购物车
 */
define("static_v4/js/mod/addcar_quick", [ "./public" ], function(require, exports, module) {
    var myPub = require("./public");
    //添加购物车动画
    var oMoveIcon = $(".js_moveIcon");
    // 加入购物车动态标记
    var oFooter = $(".js_footer");
    // 底部
    var oShopCarTip = $(".js_userNum");
    // 数量记录
    var oGoodsAddQuick = $(".js_goodsAddQuick");
    var oSideBox = $(".js_sideBox");
    // 侧边栏
    var oLoadingPage = $(".js_loadingPage");
    // 加载框
    var oShopCar_tip = $(".js_shopCar_tip");
    // 收藏加入购物车提示
    var AddBtn, clearTime, time1, time2, addOneTime;
    var dbTapOff = true;
    oGoodsAddQuick.hammer().off("tap");
    oGoodsAddQuick.hammer().on("tap", function(e) {
        if (dbTapOff) {
            //阻止多次点击 true 可点击  
            var _tag = e.gesture.target;
            var $target;
            _tag.nodeName.toLowerCase() == "p" ? $target = $(_tag) : $target = $(_tag).parents("p");
            var _X = e.gesture.center.x;
            var _Y = e.gesture.center.y;
            var win_Width = $(window).width();
            var win_Height = $(window).height();
            var oFooterH = oFooter.height();
            var oJSAddCar = $target.parents("li").find(".js_addCar");
            var pid = oJSAddCar.attr("pId");
            var regionId = oJSAddCar.attr("regionId") == undefined ? "" : oJSAddCar.attr("regionId");
            var $requestid = oJSAddCar.attr("requestid");
            var requestid = "";
            var scenetype = "";
            if ($requestid && $requestid != "undefined" && $requestid != "null") {
                requestid = $requestid;
            }
            var goodschannel = oJSAddCar.attr("goodschannel") == undefined ? "" : oJSAddCar.attr("goodschannel");
            if (goodschannel == "datagrand" || goodschannel == "not_datagrand") {
                scenetype = "cate";
            }
            var quantity = 1;
            if ($target.parents("li").find(".js_sumNum").length != 0) {
                quantity = $target.parents("li").find(".js_sumNum").val();
            }
            if ($target.length > 0 && $target[0].className == "addCar js_addCar") {
                var imgSrc = $target.parents("li").find("figure img").attr("src");
                var sLeft = "";
                var sTop = "";
                oMoveIcon.find("img").attr("src", imgSrc);
                dbTapOff = false;
                //var aLi = $(this).find('.js_addCar');
                //判断是商家页面 改变动画 left和top
                if (window.location.pathname.search("h/store/normalStore") > 0) {
                    sLeft = oSideBox.position().left + oMoveIcon.width() / 2;
                    sTop = oSideBox.position().top + oMoveIcon.width() * 1.5;
                } else if (window.location.pathname.search("cartItem/showCart") > 0) {
                    oLoadingPage.show();
                } else {
                    sLeft = win_Width * .63 - oMoveIcon.width() / 2;
                    sTop = win_Height - oFooterH - oMoveIcon.height() - oMoveIcon.height() / 10;
                }
                G_JSON_POST("/shop/cartItem/addCart", {
                    pId: pid,
                    quantity: quantity,
                    regionId: regionId,
                    goodschannel: goodschannel
                }, function(data) {
                    if (data.status == "success") {
                        var totalQuantity = data.totalQuantity;
                        if ($(".js_rightActive").length > 0) {
                            $target.append('<i class="addCarAnimate js_addCarAnimate">+1</i>');
                            clearTimeout(addOneTime);
                            addOneTime = setTimeout(function() {
                                $(".js_addCarAnimate").remove();
                                dbTapOff = true;
                            }, 1200);
                        } else {
                            myPub.AddCarAnimate(_X, _Y, oMoveIcon, sLeft, sTop, oFooterH, function() {
                                // 修改购物车数量
                                oShopCarTip.show().html(totalQuantity).addClass("mybounceIn");
                                // oShopCarTip.show().addClass('mybounceIn');
                                clearTimeout(clearTime);
                                clearTime = setTimeout(function() {
                                    oShopCarTip.removeClass("mybounceIn");
                                    dbTapOff = true;
                                }, 1200);
                            });
                        }
                        if (window.location.pathname.search("cartItem/showCart") > 0 || window.location.pathname.search("myInfo/toMyInfo")) {
                            var tipText = '<span class="icon-check-cir icon_myLayer_red"></span><span class="icon_myLayer_normal">加入购物车成功！</span>';
                            var tipStyle = "background-color: rgba(0,0,0,.6); color: #FFFFFF; min-width: 25%;";
                            if (oShopCarTip.length > 0) {
                                myPub.AddCarAnimate(_X, _Y, oMoveIcon, sLeft, sTop, oFooterH, function() {
                                    // 修改购物车数量
                                    oShopCarTip.show().html(totalQuantity).addClass("mybounceIn");
                                    // oShopCarTip.show().addClass('mybounceIn');
                                    clearTimeout(clearTime);
                                    clearTime = setTimeout(function() {
                                        oShopCarTip.removeClass("mybounceIn");
                                        dbTapOff = true;
                                    }, 1200);
                                });
                            } else {
                                myPub.TipLayer(tipText, tipStyle, function() {
                                    oLoadingPage.hide();
                                });
                            }
                        }
                        // 收藏加入购物车提示
                        if (oShopCar_tip.length > 0) {
                            oShopCar_tip.fadeIn();
                        }
                        // 添加用户行为
                        var setActionData = {};
                        setActionData.pid = pid * 1;
                        setActionData.num = 1;
                        setActionData.requestid = requestid;
                        setActionData.scenetype = scenetype;
                        // setActionData.goodschannel = goodschannel;
                        // console.log('setActionData', setActionData)
                        userAction($target, "cart", setActionData);
                    } else {
                        myPub.TipLayer(data.message);
                        oLoadingPage.hide();
                        clearTimeout(time1);
                        time1 = setTimeout(function() {
                            dbTapOff = true;
                        }, 1200);
                    }
                    myPub.HamstopPropaga();
                }, function() {}, function() {
                    //完成
                    clearTimeout(time2);
                    time2 = setTimeout(function() {
                        oShopCar_tip.fadeOut();
                        dbTapOff = true;
                    }, 1200);
                });
                myPub.HamstopPropaga();
                e.stopPropagation();
            }
        }
    });
    // 添加用户行为
    function userAction(obj, mode, keyword) {
        ddjhoc.setData(obj, mode, "add", function() {
            console.log("params." + mode, ddjhoc.params);
            ddjhoc.sendData(ddjhoc.params);
        }, keyword);
    }
});
var baseurl = "";

var smallImgArg = "?x-oss-process=style/goods_img_3";

var smallImgArg300 = "?x-oss-process=style/goods_img_2";

var smallImgArg200 = "?x-oss-process=style/goods_img";

function check_support_webp() {
    var isSupportWebp = document.createElement("canvas").toDataURL("image/webp").indexOf("data:image/webp") == 0;
    return isSupportWebp;
}

if (check_support_webp()) {
    smallImgArg = "?x-oss-process=style/goods_webp_3";
    smallImgArg300 = "?x-oss-process=style/goods_webp_2";
    smallImgArg200 = "?x-oss-process=style/goods_webp";
}

define("static_v4/js/mod/public", [], function(require, exports, module) {
    var _this = this;
    //yx
    //var httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
    //zs
    //var httpImageUrl="https://sfddj-img-bucket.oss-cn-shenzhen.aliyuncs.com/";
    var httpImageUrl;
    var myDoMain = "";
    if (window.location.host == "m.sfddj.com" || window.location.host == "120.76.47.184" || window.location.host == "120.76.207.85" || window.location.host == "120.76.44.28") {
        // httpImageUrl="https://sfddj-img-bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.sfddj.com/";
        myDoMain = "https://m.sfddj.com";
    } else if (window.location.host == "hdm.sfddj.com") {
        httpImageUrl = "https://img.sfddj.com/";
        myDoMain = "https://hdm.sfddj.com";
    } else if (window.location.host == "itsm.sfddj.com") {
        // httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://itsm.sfddj.com";
    } else if (window.location.host == "shop.fx-sf.com") {
        // httpImageUrl="https://fm95338bucket.oss-cn-shenzhen.aliyuncs.com/";
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://shop.fx-sf.com";
    } else if (window.location.host == "www.shhyxypsx.com") {
        httpImageUrl = "https://img.fx-sf.com/";
        myDoMain = "https://www.shhyxypsx.com";
    } else if (window.location.hostname == "localhost") {
        httpImageUrl = "http://img-dev.sfddj.com/";
        myDoMain = "http://localhost:8082";
    }
    exports.httpImageUrl = httpImageUrl;
    exports.myDoMain = myDoMain;
    //加入购物车的动画
    function AddCarAnimate(_X, _Y, target, sLeft, sTop, offsetDis, callBack) {
        // var _X = e.gesture.center.x;
        // var _Y = e.gesture.center.y;
        var time = null;
        var timeTwo = null;
        target.removeClass("myRotateFast");
        target.css({
            left: _X,
            top: _Y,
            opacity: 1
        });
        clearTimeout(time);
        time = setTimeout(function() {
            target.addClass("myRotateFast").stop().animate({
                left: _X,
                top: _Y - 50,
                opacity: 1
            }, 300, function() {
                target.stop().animate({
                    left: sLeft,
                    top: sTop
                }, 600, function() {
                    target.removeClass("myRotateFast");
                    clearTimeout(timeTwo);
                    timeTwo = setTimeout(function() {
                        target.stop().animate({
                            top: sTop + offsetDis * 2,
                            opacity: 0
                        }, 200, function() {
                            if (callBack) callBack();
                        });
                    }, 200);
                });
            });
        }, 30);
    }
    exports.AddCarAnimate = AddCarAnimate;
    // hammer 冒泡
    function HamstopPropaga() {
        window.event.returnValue = false;
        return false;
    }
    exports.HamstopPropaga = HamstopPropaga;
    //hammer事件
    function HammerEvent(obj) {
        this.obj = obj;
    }
    HammerEvent.prototype.addHamEvent = function(obj, type, fn) {
        this.obj = new Hammer.Manager(obj);
        this.obj.add(new Hammer.Pan({
            velocity: 0,
            threshold: 120,
            direction: Hammer.DIRECTION_ALL
        }));
        //平滑
        this.obj.add(new Hammer.Swipe({
            threshold: 8,
            direction: Hammer.DIRECTION_ALL
        }));
        this.obj.add(new Hammer.Tap({}));
        this.obj.add(new Hammer.Press({
            velocity: .6,
            threshold: 8
        }));
        //长时间下压
        this.obj.off(type);
        this.obj.on(type, function(e) {
            if (fn) fn(e);
        });
    };
    exports.HammerEvent = HammerEvent;
    /* 数字验证 */
    function ValiNum(obj, fn1, fn2) {
        var reg = new RegExp("^[0-9]*$");
        if (!reg.test(obj.val())) {
            if (fn1) fn1();
        } else if (obj.val() <= 0) {
            // TipLayer("数量不能小余1");
            obj.val(1);
        } else {
            if (fn2) fn2();
        }
    }
    exports.ValiNum = ValiNum;
    /* 字数统计 */
    function statInputNum(textArea, numItem) {
        var max = [];
        var curLength = [];
        textArea.each(function(i) {
            max[i] = parseInt(numItem.eq(i).text());
            if (textArea.eq(i).val().length > 0) {
                curLength[i] = textArea.eq(i).val().length;
                numItem.eq(i).empty().text(max[i] - curLength[i]);
            }
            textArea.eq(i).attr("maxlength", max[i]).on("input propertychange", function() {
                curLength[i] = $(this).val().length;
                numItem.eq(i).empty().text(max[i] - curLength[i]);
            });
        });
    }
    exports.statInputNum = statInputNum;
    /* 购物车价格统计 */
    function ShopSumPrice(obj, tarFather, target, sumPrice) {
        var _price = 0;
        obj.each(function(i) {
            if (obj.eq(i).hasClass("active")) {
                var _oGoodsPrice = obj.eq(i).parents(tarFather).find(target);
                _oGoodsPrice.each(function(i) {
                    _price += _oGoodsPrice.eq(i).text() * 1;
                    return _price;
                });
            }
        });
        sumPrice.text(_price.toFixed(2));
    }
    exports.ShopSumPrice = ShopSumPrice;
    /*************** 弹框效果 s***************/
    //提示框
    function TipLayer(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shadeClose: false,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayer = TipLayer;
    //提示框_没有遮罩层
    function TipLayer_noShade(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shade: false,
            shadeClose: false,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayer_noShade = TipLayer_noShade;
    //框消失后执行回调提示框
    function TipLayerEnd(sCont, sStyle, fn, T) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            time: T || 2,
            shadeClose: false,
            end: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerEnd = TipLayerEnd;
    // 用户手动关闭弹框
    function TipLayerLong(sCont, sStyle) {
        layer.open({
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            shadeClose: true
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerLong = TipLayerLong;
    // 用户手动关闭弹框有关闭按钮
    function TipLayerLongClose(sTit, sCont, sStyle, fn) {
        layer.open({
            title: sTit != "no" ? sTit : "",
            content: sCont,
            style: sStyle != "no" ? sStyle : "background-color:rgba(255,255,255,1); color:#252525; border:none; border-radius: 5px;",
            scrollbar: false,
            shadeClose: true,
            closeBtn: 1,
            success: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipLayerLongClose = TipLayerLongClose;
    //带按钮提示框
    function TipBtnLayer(sCont, sTit, btnName, yesFn, cancelFn, fn) {
        layer.open({
            title: sTit != "no" ? sTit : "",
            content: sCont,
            btn: btnName == undefined ? [ "确定" ] : [ btnName ],
            shadeClose: false,
            scrollbar: false,
            yes: function() {
                if (yesFn) yesFn();
                LayerCloseAll();
            },
            cancel: function() {
                if (cancelFn) cancelFn();
            },
            success: function() {
                if (fn) fn();
                $(".layermbtn span").css({
                    width: "100%"
                });
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipBtnLayer = TipBtnLayer;
    // 标题提示框
    function TipTitleLayer(sTitle, styleTit, sCont, fn) {
        layer.open({
            title: [ sTitle, "background-color:#fff; color:#666; font-weight:bold" ],
            content: sCont,
            shadeClose: false,
            scrollbar: false,
            style: styleTit,
            cancel: function() {
                if (fn) fn();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.TipTitleLayer = TipTitleLayer;
    //询问层
    function askLayer(sCont, yesFn, noFn, sTit, callBack, aBtnName) {
        layer.open({
            //no 为没有标题 sTit为设置标题
            title: sTit != "no" ? sTit : "",
            content: sCont,
            btn: aBtnName == undefined ? [ "确认", "取消" ] : aBtnName,
            shadeClose: false,
            scrollbar: false,
            yes: yesFn,
            no: noFn,
            cancel: noFn,
            success: function() {
                if (callBack) callBack();
            }
        });
        NoTouchMove($(".laymshade"));
    }
    exports.askLayer = askLayer;
    // 关闭所有弹框
    function LayerCloseAll() {
        layer.closeAll();
    }
    exports.LayerCloseAll = LayerCloseAll;
    //加载层
    function loadLayer(cont) {
        layer.open({
            type: 2,
            content: cont,
            shadeClose: false
        });
        NoTouchMove($(".laymshade"));
    }
    exports.loadLayer = loadLayer;
    //防止滑动
    function NoTouchMove(obj) {
        obj.on("touchmove", function() {
            return false;
        });
    }
    exports.NoTouchMove = NoTouchMove;
    /*************** 弹框效果 e***************/
    //节流控制
    function throttle(method, context, time) {
        time == undefined ? time = 200 : time = time;
        //console.log(time)
        clearTimeout(method.tId);
        method.tId = setTimeout(function() {
            method.call(context);
        }, time);
    }
    exports.throttle = throttle;
    //s20是代表20秒 h是指小时，如12小时则是：h12 d是天数，30天则：d30
    //写cookies setCookie("name","hayden",'s20');
    function setCookie(name, value, time) {
        var strsec;
        if (time == undefined) {
            var Days = 30;
            //默认30天有效期
            strsec = Days * 24 * 60 * 60 * 1e3;
        } else {
            strsec = getsec(time) * 1;
        }
        var exp = new Date();
        exp.setTime(exp.getTime() + strsec);
        document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
    }
    exports.setCookie = setCookie;
    //读取cookies getCookie("name")
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg)) {
            return unescape(arr[2]);
        } else {
            return null;
        }
    }
    exports.getCookie = getCookie;
    //删除cookies delCookie('name')
    function delCookie(name) {
        var exp = new Date();
        exp.setTime(exp.getTime() - 1);
        var cval = getCookie(name);
        if (cval != null) document.cookie = name + "=" + cval + ";expires=" + exp.toGMTString() + ";path=/";
    }
    exports.delCookie = delCookie;
    //设置cookie时间
    function getsec(str) {
        var str1 = str.substring(1, str.length) * 1;
        var str2 = str.substring(0, 1);
        if (str2 == "s") {
            return str1 * 1e3;
        } else if (str2 == "h") {
            return str1 * 60 * 60 * 1e3;
        } else if (str2 == "d") {
            return str1 * 24 * 60 * 60 * 1e3;
        }
    }
    /* 验证码倒计时 */
    function CutTime(time, fn1, fn2) {
        var _AllTime = time;
        var _T = null;
        clearInterval(_T);
        _T = setInterval(function() {
            if (time <= 0) {
                clearInterval(_T);
                if (fn1) fn1(_AllTime);
            } else {
                time--;
                if (fn2) fn2(time);
            }
        }, 1e3);
    }
    exports.CutTime = CutTime;
    /*手机号码验证*/
    function checkMobile(obj, fn1, fn2, fn3) {
        var oIphone = obj.val();
        var reg = /^(1[1|2|3|4|5|6|7|8|9])[\d]{9}$/;
        //验证手机号码
        if (oIphone == "") {
            if (fn1) fn1();
        } else if (!reg.test(oIphone)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkMobile = checkMobile;
    /*密码验证*/
    function checkPassWord(obj, fn1, fn2, fn3) {
        var _val = obj.val();
        var reg = /^[a-zA-Z0-9]{6,20}$/;
        //6-20位数字和英文
        if (_val == "") {
            if (fn1) fn1();
        } else if (!reg.test(_val)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkPassWord = checkPassWord;
    /*用户名验证*/
    function checkUserName(obj, fn1, fn2, fn3) {
        var _userName = obj.val();
        var reg = /^[A-Za-z\u4e00-\u9fa5][A-Za-z0-9\u4e00-\u9fa5]{1,9}$/;
        //验证用户名
        if (_userName == "") {
            if (fn1) fn1();
        } else if (!reg.test(_userName)) {
            if (fn2) fn2();
        } else {
            if (fn3) fn3();
        }
    }
    exports.checkUserName = checkUserName;
    //图片预加载(window)
    function lazLoadingImgEcho(obj, fn) {
        echo.init({
            container: obj,
            offset: 300,
            throttle: 50,
            //设置图片延迟加载的时间 
            callback: function(element, op) {
                if (fn) fn(element, op);
                // console.log(element, 'has been', op + 'ed')
                var $el = $(element);
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
            }
        });
    }
    exports.lazLoadingImgEcho = lazLoadingImgEcho;
    function lazLoadingImg(obj) {
        this.obj = obj;
    }
    //添加图片预加载
    lazLoadingImg.prototype.AddLazLoadingImg = function(obj, fn) {
        this.obj = echoChangeByCc.initNew({
            container: obj,
            unload: false,
            offset: 300,
            throttle: 80,
            //设置图片延迟加载的时间
            callback: function(element, op) {
                var $el = $(element);
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
                if (fn) fn();
            }
        });
    };
    // 图片预加载 销毁
    lazLoadingImg.prototype.DestroyLazLoadingImg = function() {
        var _this = this.obj;
        if (_this && _this.detach) {
            _this.detach();
        }
    };
    // 图片预加载 刷新
    lazLoadingImg.prototype.RushLazLoadingImg = function() {
        var _this = this.obj;
        _this.render();
    };
    function loadImageCheck(url, callback) {
        //创建一个Image对象，实现图片的预下载
        var img = new Image();
        img.src = url;
        // 如果图片已经存在于浏览器缓存，直接调用回调函数
        if (img.complete) {
            callback();
            img = null;
            return;
        }
        img.onload = function() {
            //图片下载完毕时异步调用callback函数。
            callback();
            img = null;
        };
    }
    exports.lazLoadingImg = lazLoadingImg;
    function lazLoadingImgEchoAbs(obj, fn) {
        echoChangeByCc.initNew({
            container: obj,
            unload: false,
            offset: 200,
            throttle: 30,
            //设置图片延迟加载的时间
            callback: function(element, op) {
                var $el = $(element);
                // console.log($el)
                var sUl = $el.attr("src");
                loadImageCheck(sUl, function() {
                    $el.addClass("fadeIn");
                    $el = null;
                });
                if (fn) fn();
            }
        });
    }
    exports.lazLoadingImgEchoAbs = lazLoadingImgEchoAbs;
    //mui插件事件开关
    function OffMuiEvent(arg) {
        mui.init({
            gestureConfig: {
                tap: arg,
                //默认为true
                swipe: arg
            }
        });
    }
    exports.OffMuiEvent = OffMuiEvent;
    //设置li图片高度 父级获取
    function SetImgHeight(obj, getWidth) {
        var htmlFontSize = $("html").css("font-size");
        var intSize = htmlFontSize.split("p")[0];
        var imgWidth = null;
        if (obj[0].nodeName.toLowerCase() === "li") {
            getWidth ? imgWidth = getWidth / intSize : imgWidth = obj.find("figure").eq(0).parents("a").width() / intSize;
            // obj.find('figure:not(:first)').css({'height': imgWidth+'rem', 'width': imgWidth+'rem'});
            obj.find("figure").css({
                height: imgWidth + "rem",
                width: imgWidth + "rem"
            });
        } else {
            getWidth ? imgWidth = getWidth / intSize : imgWidth = obj.find("li figure").eq(0).parents("a").width() / intSize;
            // obj.find('li figure:not(:first)').css({'height': imgWidth+'rem', 'width': imgWidth+'rem'});
            obj.find("li figure").css({
                height: imgWidth + "rem",
                width: imgWidth + "rem"
            });
        }
    }
    exports.SetImgHeight = SetImgHeight;
    // 日期 2015-09-01 11:16:00
    function FormatDateTime(date, minType, point) {
        var y = date.getFullYear();
        var m = date.getMonth() + 1;
        m = m < 10 ? "0" + m : m;
        var d = date.getDate();
        d = d < 10 ? "0" + d : d;
        var h = date.getHours();
        h = h < 10 ? "0" + h : h;
        var minute = date.getMinutes();
        minute = minute < 10 ? "0" + minute : minute;
        var seconds = date.getSeconds();
        seconds = seconds < 10 ? "0" + seconds : seconds;
        var _sep = "-";
        if (point) _sep = point;
        // 最小到天
        if (minType == "minDay") {
            return y + _sep + m + _sep + d;
        } else if (minType == "minMinute") {
            return y + _sep + m + _sep + d + " " + h + ":" + minute;
        } else {
            return y + _sep + m + _sep + d + " " + h + ":" + minute + ":" + seconds;
        }
    }
    exports.FormatDateTime = FormatDateTime;
    /*************** 滚动条效果 s***************/
    function ScrollBar(obj) {
        this.obj = obj;
    }
    //添加滚动条
    ScrollBar.prototype.AddScroll = function(obj, sOptions) {
        this.obj = new JRoll(obj, sOptions);
    };
    //刷新滚动条
    ScrollBar.prototype.ReScroll = function(fn) {
        var _this = this.obj;
        _this.refresh();
        if (fn) fn();
    };
    //删除滚动条
    ScrollBar.prototype.DelScroll = function(fn) {
        var _this = this.obj;
        _this.destroy();
        if (fn) fn();
    };
    //滚动 到 0
    ScrollBar.prototype.ScrollTo = function(x, y, time, fn) {
        var _this = this.obj;
        _this.scrollTo(x, y, time, false, function() {
            if (fn) fn(_this);
        });
    };
    //滚动开始事件
    ScrollBar.prototype.ScrollStart = function(fn) {
        var _this = this.obj;
        _this.on("scrollStart", fn);
    };
    //滚动结束事件
    ScrollBar.prototype.ScrollEnd = function(fn1, fn2) {
        var _this = this.obj;
        _this.on("scrollEnd", fn1);
        if (fn2) fn2();
    };
    //滚动监听
    ScrollBar.prototype.ScrollIng = function(fn) {
        var _this = this.obj;
        //this.obj.on('scroll', fn);
        this.obj.on("scroll", function() {
            if (fn) fn(_this);
        });
    };
    //滚动下拉刷新
    ScrollBar.prototype.ScrollPullDown = function(sOptions) {
        var _this = this.obj;
        _this.pulldown(sOptions);
    };
    exports.ScrollBar = ScrollBar;
    function getFontSize() {
        var doc = document, win = window;
        var docEl = doc.documentElement, resizeEvt = "orientationchange" in window ? "orientationchange" : "resize", recalc = function() {
            var clientWidth = docEl.clientWidth;
            if (!clientWidth) return;
            //如果屏幕大于750（750是根据我效果图设置的，具体数值参考效果图），就设置clientWidth=750，防止font-size会超过100px
            if (clientWidth > 750) {
                clientWidth = 750;
            }
            //设置根元素font-size大小
            docEl.style.fontSize = 100 * (clientWidth / 750) + "px";
        };
        //屏幕大小改变，或者横竖屏切换时，触发函数
        win.addEventListener(resizeEvt, recalc, false);
        //文档加载完成时，触发函数
        // doc.addEventListener('DOMContentLoaded', recalc, false);
        $(doc).ready(function() {
            recalc();
        });
    }
    exports.getFontSize = getFontSize;
    function getGoodsNo(url) {
        var reg = new RegExp("^YW[a-zA-Z0-9]{12,14}$");
        var aUrl = "";
        if (!url) return;
        if (url.indexOf("/") > -1) {
            aUrl = url.substr(0).split("/");
            for (var i = 0; i < aUrl.length; i++) {
                if (checkField(aUrl[i])) {
                    return checkField(aUrl[i]);
                } else if (checkField(aUrl[i]) == undefined) {
                    return false;
                }
            }
        } else {
            if (checkField(url)) {
                return checkField(url);
            } else if (checkField(url) == undefined) {
                return false;
            }
        }
        function checkField(_url) {
            var _aUrl = "";
            if (_url.length >= 14) {
                if (_url.indexOf("?") > 0) {
                    _aUrl = _url.split("?");
                    for (var i = 0; i < _aUrl.length; i++) {
                        if (reg.test(_aUrl[i])) {
                            return _aUrl[i];
                        }
                    }
                } else {
                    if (reg.test(_url)) {
                        return _url;
                    } else {
                        return false;
                    }
                }
            } else {
                return false;
            }
        }
    }
    exports.getGoodsNo = getGoodsNo;
    // 检测 安卓 ios 分享 大当家 链接跳转
    function JudgeAppHref(obj) {
        var _href = "";
        var _Num = 0;
        var u = navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        // 返回首页操作
        var hrefToHome = [ "/", "sf://" ];
        var hrefName = [ "/h/goodspay/goodsView/", "sf://goodsDetail?goodsSn=" ];
        var sLocationArg = window.location.search.split("?")[1];
        var fxBtn = false;
        if (sLocationArg !== undefined) {
            if (sLocationArg.search("sell_member_id") > -1) {
                fxBtn = true;
            }
        }
        // console.log('我进来检测了')
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                _Num = 1;
                obj.each(function(i) {
                    _href = obj.eq(i).attr("_href");
                    // 检测回到首页
                    if (_href === "home") {
                        obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                    } else {
                        if (getGoodsNo(_href)) {
                            obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                });
            } else {
                obj.each(function(i) {
                    // 检测回到首页
                    _href = obj.eq(i).attr("_href");
                    if (_href === "home") {
                        AndroidReHome(obj.eq(i));
                    } else {
                        if (getGoodsNo(_href)) {
                            //要去掉a标签自带的href属性，因为这个跳转比点击事件要快，如果有这个属性在安卓上会跳转两次
                            obj.eq(i).removeAttr("href");
                            AndroidGoods(obj.eq(i), getGoodsNo(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                });
            }
        } else if (window.__wxjs_environment === "miniprogram") {
            obj.each(function(i) {
                // 如果有_href 这个自定义属性，_href 只有等于 home 或者 商品编号，就回到小程序页面；
                _href = obj.eq(i).attr("_href");
                if (_href) {
                    // 禁用掉 href
                    // obj.eq(i).attr("href", "javascript:void(0);");
                    obj.eq(i).removeAttr("href");
                    // 检测回到首页
                    if (_href === "home") {
                        minAppEven(obj.eq(i));
                    } else {
                        if (getGoodsNo(_href)) {
                            minAppEven(obj.eq(i), getGoodsNo(_href));
                        } else if (isDrawCouponLink(_href)) {
                            minAppEven(obj.eq(i), false, "/pages/home/drawCoupon/drawCoupon?ruleSign=" + isDrawCouponLink(_href));
                        } else {
                            obj.eq(i).attr("href", _href);
                        }
                    }
                }
            });
        } else if (fxBtn) {
            _Num = 0;
            obj.each(function(i) {
                _href = obj.eq(i).attr("_href");
                if (_href === "home") {
                    obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                } else {
                    if (getGoodsNo(_href)) {
                        obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href) + "?" + sLocationArg);
                    } else {
                        obj.eq(i).attr("href", _href + "?" + sLocationArg);
                    }
                }
            });
        } else {
            _Num = 0;
            obj.each(function(i) {
                _href = obj.eq(i).attr("_href");
                var appendData = _href.indexOf("?") > -1 ? "?" + _href.split("?")[1] : "";
                if (_href === "home") {
                    obj.eq(i).attr("href", hrefToHome[_Num] + _href);
                } else {
                    if (getGoodsNo(_href)) {
                        obj.eq(i).attr("href", hrefName[_Num] + getGoodsNo(_href) + appendData);
                    } else {
                        obj.eq(i).attr("href", _href);
                    }
                }
            });
        }
    }
    exports.JudgeAppHref = JudgeAppHref;
    //判断是否是h5的领券页
    function isDrawCouponLink(url) {
        // var  reg = new RegExp("^YW[a-zA-Z0-9]{12,14}$");
        var ruleSignStr = "";
        if (!url) return false;
        if (url.indexOf("/coupon/drawCoupon") > -1) {
            ruleSignStr = url.split("ruleSign=")[1];
            if (ruleSignStr.indexOf("&") > -1) {
                var ruleSign = ruleSignStr.split("&")[0];
                return ruleSign;
            } else {
                return ruleSignStr;
            }
        } else {
            return false;
        }
    }
    exports.isDrawCouponLink = isDrawCouponLink;
    // 小程序事件处理
    function minAppEven(obj, arg, url) {
        obj.off("click");
        obj.on("click", function() {
            // console.log(arg)
            // 小程序物品详情
            if (arg) {
                wx.miniProgram.navigateTo({
                    url: "/pages/shopping/goodsDetail/goodsDetail?goodsSn=" + arg
                });
            } else if (url) {
                wx.miniProgram.navigateTo({
                    url: url
                });
            } else {
                wx.miniProgram.switchTab({
                    url: "/pages/home/home"
                });
            }
        });
    }
    // 安卓绑定点击事件
    function AndroidGoods(obj, arg) {
        obj.off("click");
        obj.on("click", function() {
            android.goodsDetail(arg);
        });
    }
    // 安卓绑定点击返回首页
    function AndroidReHome(obj) {
        obj.off("click");
        obj.on("click", function() {
            android.toMainAcivity();
        });
    }
    function removeArrayChildren(arr, val) {
        var index = arr.indexOf(val);
        if (index > -1) {
            arr.splice(index, 1);
        }
    }
    exports.removeArrayChildren = removeArrayChildren;
    // 弹框获取焦点后 页面高度调整
    function setFocusBodyScrollTop(timer, fn) {
        var cnt = 0;
        var oBody = $("body");
        timer = setInterval(function() {
            if (cnt < 3) {
                cnt++;
            } else {
                clearInterval(timer);
                timer = null;
                return;
            }
            oBody[0].scrollTop = oBody[0].scrollHeight;
            if (fn) fn();
        }, 300);
    }
    exports.setFocusBodyScrollTop = setFocusBodyScrollTop;
    function locationHref(href) {
        $("body").append($('<a href="' + href + '"><span id="locationHrefId"><span><a>'));
        $("#locationHrefId").click();
    }
    exports.locationHref = locationHref;
    // 检测 安卓 ios 隐藏指定对象
    function JudgeAppHide(ios, and, h5) {
        var u = navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                if (ios) ios();
            } else {
                if (and) and();
            }
        } else {
            if (h5) h5();
        }
    }
    exports.JudgeAppHide = JudgeAppHide;
    function isIphoneXsMinX() {
        return /iphone/gi.test(navigator.userAgent) && screen.height == 812 && screen.width == 375;
    }
    exports.isIphoneXsMinX = isIphoneXsMinX;
    function isIphoneXRXSMax() {
        return /iphone/gi.test(navigator.userAgent) && screen.height == 896 && screen.width == 414;
    }
    exports.isIphoneXRXSMax = isIphoneXRXSMax;
    /**
     * 判断是否是微信浏览器
     * @returns {Boolean}
     */
    function isWeiXin() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/MicroMessenger/i) == "micromessenger") {
            return true;
        } else {
            return false;
        }
    }
    exports.isWeiXin = isWeiXin;
    /**
     * 判断是否是支付宝浏览器
     * @returns {boolean}
     */
    function isAlipayClient() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/AlipayClient/i) == "alipayclient") {
            return true;
        } else {
            return false;
        }
    }
    exports.isAlipayClient = isAlipayClient;
    /**
     * 判断是否是QQ内置浏览器
     * @returns {boolean}
     */
    function isQQClient() {
        var ua = window.navigator.userAgent.toLowerCase();
        if (ua.match(/QQ/i) == "qq") {
            return true;
        } else {
            return false;
        }
    }
    exports.isQQClient = isQQClient;
    //XSS 前端过滤
    function XssCheck(str, reg) {
        return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g, function(a, b) {
            if (b) {
                return a;
            } else {
                return {
                    "<": "&lt;",
                    "&": "&amp;",
                    '"': "&quot;",
                    ">": "&gt;",
                    "'": ""
                }[a];
            }
        }) : "";
    }
    exports.XssCheck = XssCheck;
    /*
    * 判断用户是否安装app,已安装就跳app,未安装就正常跳h5页面
    * 因可能有安卓跳A页面，ios跳B页面的情况，所以两种终端的url分开写
    * androidUrl, iosUrl是跳的指定页面  比如'https://m.sfddj.com/coupon/toCouponCenter'
    * 如果没有指定页面(首页)就不填写或者填写空'' 如isHasApp('','',function(){})或者isHasApp()
    * */
    function isHasApp(androidUrl, iosUrl, fn) {
        var u = navigator.userAgent;
        var isAndroid = u.indexOf("Android") > -1 || u.indexOf("Linux") > -1;
        //android终端或者uc浏览器
        var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        if (u.search("origin/sfddjapp") == -1) {
            if (isAndroid) {
                // 在安卓的终端
                var HrefUrl = "";
                if (androidUrl && androidUrl != undefined && androidUrl != "") {
                    HrefUrl = "ddjapp://cn.dankal.sf/webpage?url=" + androidUrl;
                } else {
                    HrefUrl = "ddjapp://cn.dankal.sf/android";
                }
                // window.location.href = HrefUrl;
                locationHref(HrefUrl);
                setTimeout(function() {
                    if (fn) fn();
                }, 2e3);
            } else if (isiOS) {
                // 在ios的终端
                var HrefUrl = "";
                if (iosUrl && iosUrl != undefined && iosUrl != "") {
                    HrefUrl = "ddjapk://weburl?url=" + iosUrl;
                } else {
                    HrefUrl = "ddjapk://cn.dankal.sf";
                }
                window.location.href = HrefUrl;
                setTimeout(function() {
                    if (fn) fn();
                }, 2e3);
            }
        } else {}
    }
    exports.isHasApp = isHasApp;
});
define("static_v4/js/plug/base64", [], function(require, exports, module) {
    module.exports = new Base64();
    function Base64() {
        // private property
        _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
        // public method for encoding
        this.encode = function(input) {
            var output = "";
            var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
            var i = 0;
            input = _utf8_encode(input);
            while (i < input.length) {
                chr1 = input.charCodeAt(i++);
                chr2 = input.charCodeAt(i++);
                chr3 = input.charCodeAt(i++);
                enc1 = chr1 >> 2;
                enc2 = (chr1 & 3) << 4 | chr2 >> 4;
                enc3 = (chr2 & 15) << 2 | chr3 >> 6;
                enc4 = chr3 & 63;
                if (isNaN(chr2)) {
                    enc3 = enc4 = 64;
                } else if (isNaN(chr3)) {
                    enc4 = 64;
                }
                output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
            }
            return output;
        };
        // public method for decoding
        this.decode = function(input) {
            var output = "";
            var chr1, chr2, chr3;
            var enc1, enc2, enc3, enc4;
            var i = 0;
            input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
            while (i < input.length) {
                enc1 = _keyStr.indexOf(input.charAt(i++));
                enc2 = _keyStr.indexOf(input.charAt(i++));
                enc3 = _keyStr.indexOf(input.charAt(i++));
                enc4 = _keyStr.indexOf(input.charAt(i++));
                chr1 = enc1 << 2 | enc2 >> 4;
                chr2 = (enc2 & 15) << 4 | enc3 >> 2;
                chr3 = (enc3 & 3) << 6 | enc4;
                output = output + String.fromCharCode(chr1);
                if (enc3 != 64) {
                    output = output + String.fromCharCode(chr2);
                }
                if (enc4 != 64) {
                    output = output + String.fromCharCode(chr3);
                }
            }
            output = _utf8_decode(output);
            return output;
        };
        // private method for UTF-8 encoding
        _utf8_encode = function(string) {
            string = string.replace(/\r\n/g, "\n");
            var utftext = "";
            for (var n = 0; n < string.length; n++) {
                var c = string.charCodeAt(n);
                if (c < 128) {
                    utftext += String.fromCharCode(c);
                } else if (c > 127 && c < 2048) {
                    utftext += String.fromCharCode(c >> 6 | 192);
                    utftext += String.fromCharCode(c & 63 | 128);
                } else {
                    utftext += String.fromCharCode(c >> 12 | 224);
                    utftext += String.fromCharCode(c >> 6 & 63 | 128);
                    utftext += String.fromCharCode(c & 63 | 128);
                }
            }
            return utftext;
        };
        // private method for UTF-8 decoding
        _utf8_decode = function(utftext) {
            var string = "";
            var i = 0;
            var c = c1 = c2 = 0;
            while (i < utftext.length) {
                c = utftext.charCodeAt(i);
                if (c < 128) {
                    string += String.fromCharCode(c);
                    i++;
                } else if (c > 191 && c < 224) {
                    c2 = utftext.charCodeAt(i + 1);
                    string += String.fromCharCode((c & 31) << 6 | c2 & 63);
                    i += 2;
                } else {
                    c2 = utftext.charCodeAt(i + 1);
                    c3 = utftext.charCodeAt(i + 2);
                    string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63);
                    i += 3;
                }
            }
            return string;
        };
    }
});
/**
 * 地区管展示 20180104 mxm
 */
define("static_v4/js/mod/areaList", [ "./public" ], function(require, exports, module) {
    var myPub = require("./public");
    var areaName = [ {
        name: "华南区",
        "class": "huanan-museum"
    }, {
        name: "华东区",
        "class": "huadong-museum"
    }, {
        name: "华北区",
        "class": "huabei-museum"
    }, {
        name: "中南区",
        "class": "zhongnan-museum"
    }, {
        name: "华西区",
        "class": "huaxi-museum"
    } ];
    var Act = {
        init: function(obj) {
            this.huananImg = [ "/Public/static/img/cityMuseum/huanan/1guang-shenzhen.jpg", "/Public/static/img/cityMuseum/huanan/2guang-guangzhou.jpg", "/Public/static/img/cityMuseum/huanan/3guang-dongguan.jpg", "/Public/static/img/cityMuseum/huanan/4guang-hainan.jpg", "/Public/static/img/cityMuseum/huanan/5guang-foshan.jpg", "/Public/static/img/cityMuseum/huanan/6guang-zhongshan.jpg", "/Public/static/img/cityMuseum/huanan/7guang-huizhou.jpg", "/Public/static/img/cityMuseum/huanan/8guang-wuyi.jpg", "/Public/static/img/cityMuseum/huanan/9guang-chaoshan.jpg" ];
            this.huananHrefArray = [ "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B7%B1%E5%9C%B3&sell_member_id=1533328", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%B9%BF%E5%B7%9E&sell_member_id=1533309", "http://m.sfddj.com/Shop/Index/home.html?city=%E4%B8%9C%E8%8E%9E&sell_member_id=1533347", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B5%B7%E5%8F%A3&sell_member_id=1533286", "http://m.sfddj.com/Shop/Index/home.html?city=%E4%BD%9B%E5%B1%B1&sell_member_id=1533305", "http://m.sfddj.com/Shop/Index/home.html?city=%E4%B8%AD%E5%B1%B1&sell_member_id=1533346", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%83%A0%E5%B7%9E&sell_member_id=1533311", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B1%9F%E9%97%A8&sell_member_id=1533340", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B1%95%E5%A4%B4&sell_member_id=1533300" ];
            this.huadongImg = [ "/Public/static/img/cityMuseum/huadong/1guang-shanghai.jpg", "/Public/static/img/cityMuseum/huadong/2guang-nanjing.jpg", "/Public/static/img/cityMuseum/huadong/3guang-hangzhou.jpg", "/Public/static/img/cityMuseum/huadong/4guang-ningbo.jpg", "/Public/static/img/cityMuseum/huadong/5guang-wuxi.jpg", "/Public/static/img/cityMuseum/huadong/6guang-jiaxing.jpg", "/Public/static/img/cityMuseum/huadong/7guang-nantong.jpg" ];
            this.huadongHrefArray = [ "http://m.sfddj.com/Shop/Index/home.html?city=%E4%B8%8A%E6%B5%B7&sell_member_id=1533293", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8D%97%E4%BA%AC&sell_member_id=1533319", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%9D%AD%E5%B7%9E&sell_member_id=1533310", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%AE%81%E6%B3%A2&sell_member_id=1533321", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%97%A0%E9%94%A1&sell_member_id=1533339", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%98%89%E5%85%B4&sell_member_id=1533315", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8D%97%E9%80%9A&sell_member_id=1533320", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%B8%B8%E5%B7%9E&sell_member_id=1533299", "http://m.sfddj.com/Shop/Index/home.html?city=%E7%BB%8D%E5%85%B4&sell_member_id=1533327", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B7%AE%E5%AE%89&sell_member_id=1533330", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%8B%8F%E5%B7%9E&sell_member_id=1533332", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8F%B0%E5%B7%9E&sell_member_id=1533334" ];
            this.huabeiImg = [ "/Public/static/img/cityMuseum/huabei/1guang-beijing.jpg", "/Public/static/img/cityMuseum/huabei/2guang-dalian.jpg", "/Public/static/img/cityMuseum/huabei/3guang-shanxi.jpg", "/Public/static/img/cityMuseum/huabei/4guang-qingdao.jpg", "/Public/static/img/cityMuseum/huabei/5guang-jizhou.jpg", "/Public/static/img/cityMuseum/huabei/6guang-neimengu.jpg", "/Public/static/img/cityMuseum/huabei/7guang-sheyang.jpg", "/Public/static/img/cityMuseum/huabei/8guang-heilongjiang.jpg", "/Public/static/img/cityMuseum/huabei/9guang-jinan.jpg", "/Public/static/img/cityMuseum/huabei/10guang-luzhoug.jpg", "/Public/static/img/cityMuseum/huabei/11guang-yantai.jpg", "/Public/static/img/cityMuseum/huabei/12guang-jilin.jpg", "/Public/static/img/cityMuseum/huabei/13guang-tianjin.jpg", "/Public/static/img/cityMuseum/huabei/14guang-jibei.jpg" ];
            this.huabeiHrefArray = [ "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8C%97%E4%BA%AC&sell_member_id=1533281", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%A4%A7%E8%BF%9E&sell_member_id=1533301", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%A4%AA%E5%8E%9F&sell_member_id=1533291", "http://m.sfddj.com/Shop/Index/home.html?city=%E9%9D%92%E5%B2%9B&sell_member_id=1533324", "http://m.sfddj.com/Shop/Index/home.html?city=%E7%9F%B3%E5%AE%B6%E5%BA%84&sell_member_id=1533314", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%91%BC%E5%92%8C%E6%B5%A9%E7%89%B9&sell_member_id=1533289", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B2%88%E9%98%B3&sell_member_id=1533329", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%93%88%E5%B0%94%E6%BB%A8&sell_member_id=1533287", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B5%8E%E5%8D%97&sell_member_id=1533312", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%BD%8D%E5%9D%8A&sell_member_id=1533318", "http://m.sfddj.com/Shop/Index/home.html?city=%E7%83%9F%E5%8F%B0&sell_member_id=1533343", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%90%89%E6%9E%97&sell_member_id=1533288", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%A4%A9%E6%B4%A5&sell_member_id=1533295", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%BB%8A%E5%9D%8A&sell_member_id=1533313" ];
            this.zhongnanImg = [ "/Public/static/img/cityMuseum/zhongnan/1guang-wannan.jpg", "/Public/static/img/cityMuseum/zhongnan/2guang-wanbei.jpg", "/Public/static/img/cityMuseum/zhongnan/3guang-edong.jpg", "/Public/static/img/cityMuseum/zhongnan/4guang-fuzhou.jpg", "/Public/static/img/cityMuseum/zhongnan/5guang-yubei.jpg", "/Public/static/img/cityMuseum/zhongnan/6guang-yunan.jpg", "/Public/static/img/cityMuseum/zhongnan/7guang-xiameng.jpg", "/Public/static/img/cityMuseum/zhongnan/8guang-exi.jpg", "/Public/static/img/cityMuseum/zhongnan/9guang-xiangbei.jpg", "/Public/static/img/cityMuseum/zhongnan/10guang-gannan.jpg", "/Public/static/img/cityMuseum/zhongnan/11guang-xiangnan.jpg", "/Public/static/img/cityMuseum/zhongnan/12guang-ganbei.jpg", "/Public/static/img/cityMuseum/zhongnan/13guang-putian.jpg", "/Public/static/img/cityMuseum/zhongnan/14guang-quanzhou.jpg" ];
            this.zhongnanHrefArray = [ "http://m.sfddj.com/Shop/Index/home.html?city=%E9%BB%84%E5%B1%B1&sell_member_id=1533337", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%90%88%E8%82%A5&sell_member_id=1533336", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%AD%A6%E6%B1%89&sell_member_id=1533303", "http://m.sfddj.com/Shop/Index/home.html?city=%E7%A6%8F%E5%B7%9E&sell_member_id=1533306", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%96%B0%E4%B9%A1&sell_member_id=1533344", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8D%97%E9%98%B3&sell_member_id=1533345", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8E%A6%E9%97%A8&sell_member_id=1533326", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%AE%9C%E6%98%8C&sell_member_id=1533304", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%B2%B3%E9%98%B3&sell_member_id=1533341", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%B5%A3%E5%B7%9E&sell_member_id=1533308", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%A1%A1%E9%98%B3&sell_member_id=1533342", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%8D%97%E6%98%8C&sell_member_id=1533307", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%8E%86%E7%94%B0&sell_member_id=1533322", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B3%89%E5%B7%9E&sell_member_id=1533325" ];
            this.huaxiImg = [ "/Public/static/img/cityMuseum/huaxi/1guang-sichuan.jpg", "/Public/static/img/cityMuseum/huaxi/2guang-nixia.jpg", "/Public/static/img/cityMuseum/huaxi/3guang-shaxi.jpg", "/Public/static/img/cityMuseum/huaxi/4guang-xinjiang.jpg", "/Public/static/img/cityMuseum/huaxi/5guang-yunnan.jpg", "/Public/static/img/cityMuseum/huaxi/6guang-chongqing.jpg", "/Public/static/img/cityMuseum/huaxi/7guang-gansu.jpg", "/Public/static/img/cityMuseum/huaxi/8guang-guizhou.jpg" ];
            this.huaxiHrefArray = [ "http://m.sfddj.com/Shop/Index/home.html?city=%E6%88%90%E9%83%BD&sell_member_id=1533294", "http://m.sfddj.com/Shop/Index/home.html?city=%E9%93%B6%E5%B7%9D&sell_member_id=1533290", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%A5%BF%E5%AE%89&sell_member_id=1533292", "http://m.sfddj.com/Shop/Index/home.html?city=%E4%B9%8C%E9%B2%81%E6%9C%A8%E9%BD%90&sell_member_id=1533296", "http://m.sfddj.com/Shop/Index/home.html?city=%E6%B7%AE%E5%AE%89&sell_member_id=1533297", "http://m.sfddj.com/Shop/Index/home.html?city=%E9%87%8D%E5%BA%86&sell_member_id=1533298", "http://m.sfddj.com/Shop/Index/home.html?city=%E5%85%B0%E5%B7%9E&sell_member_id=1533282", "http://m.sfddj.com/Shop/Index/home.html?city=%E8%B4%B5%E9%98%B3&sell_member_id=1533284" ], 
            Act.setHtml(areaName, function() {
                Act.setHerf($(".huanan-museum ul"), Act.huananImg, Act.huananHrefArray);
                Act.setHerf($(".huadong-museum ul"), Act.huadongImg, Act.huadongHrefArray);
                Act.setHerf($(".huabei-museum ul"), Act.huabeiImg, Act.huabeiHrefArray);
                Act.setHerf($(".zhongnan-museum ul"), Act.zhongnanImg, Act.zhongnanHrefArray);
                Act.setHerf($(".huaxi-museum ul"), Act.huaxiImg, Act.huaxiHrefArray);
            });
        },
        setHerf: function(obj, sImg, sHref) {
            var imgArray = sImg;
            var dom_html = "";
            for (var i = 0; i < imgArray.length; i++) {
                dom_html += '<li class="ciy-museum-list">';
                dom_html += '	<a href="' + sHref[i] + '">';
                dom_html += '		<img src="https://m.sfddj.com' + imgArray[i] + '"/>';
                dom_html += "	</a>";
                dom_html += "</li>";
            }
            obj.html(dom_html);
        },
        setHtml: function(name, fn) {
            var _this = this;
            var sAreaListBox = $(".js_areaList");
            var sHtml = "";
            for (var i = 0; i < name.length; i++) {
                sHtml += '<div class="cityMuseum-banner">' + '   <img src="https://m.sfddj.com/Public/static/img/cityMuseum/guang-banner2.jpg"/>' + '   <span class="city-museum-name">' + name[i].name + "</span>" + "</div>" + '<div class="ciy-museum ' + name[i].class + '">' + '   <ul class="clearfix"></ul>' + "</div>";
            }
            sAreaListBox.append($(sHtml));
            if (fn) fn();
        }
    };
    function AreaListShow(fn) {
        Act.init();
        if (fn) fn();
    }
    exports.AreaListShow = AreaListShow;
});
define("static_v4/js/mod/baiduCount", [], function(require, exports, module) {
    var oBody = $("body");
    function getCookie(name) {
        var arr, reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
        if (arr = document.cookie.match(reg)) {
            return unescape(arr[2]);
        } else {
            return null;
        }
    }
    function JudgeSource(ios, and, wxmin, wx, alipay, qq, h5) {
        var u = window.navigator.userAgent;
        //var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; //android终端
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
        //ios终端
        var isWXMini = window.__wxjs_environment == "miniprogram";
        var ua = u.toLowerCase();
        var isWeiXin = ua.match(/MicroMessenger/i) == "micromessenger";
        var isAlipay = ua.match(/AlipayClient/i) == "alipayclient";
        var isQQ = ua.match(/QQ/i) == "qq";
        // 检测室安卓还是ios
        if (u.search("origin/sfddjapp") > 0) {
            if (isIOS) {
                if (ios) ios();
            } else {
                if (and) and();
            }
        } else if (isWXMini) {
            if (wxmin) wxmin();
        } else {
            if (isWeiXin) {
                if (wx) wx();
            } else if (isAlipay) {
                if (alipay) alipay();
            } else if (isQQ) {
                if (qq) qq();
            } else {
                if (h5) h5();
            }
        }
    }
    // 第三方统计的插件
    var TPLMethods = {
        userInfo: JSON.parse(getCookie("ddj-userInfo")),
        // 百度统计
        baidu: function() {
            /**
             *  百度统计
             */
            var sfddjUrl = "9a6219852c6bc360b517de9714e19810";
            //m.sfddj.com
            (function() {
                var hm = document.createElement("script");
                hm.src = "//hm.baidu.com/hm.js?" + sfddjUrl;
                // var s = document.getElementsByTagName("script")[0];
                // s.parentNode.insertBefore(hm, s);
                oBody.append(hm);
            })();
        },
        // gio 统计
        gio: function() {
            var _this = this;
            !function(e, t, n, g, i) {
                e[i] = e[i] || function() {
                    (e[i].q = e[i].q || []).push(arguments);
                }, n = t.createElement("script");
                // tag = t.getElementsByTagName("script")[0];
                // n.async = 1;
                n.src = ("https:" == document.location.protocol ? "https://" : "http://") + g;
                // tag.parentNode.insertBefore(n, tag)
                oBody.append(n);
            }(window, document, "script", "assets.growingio.com/2.1/gio.js", "gio");
            var _gioSetUserId = "";
            if (_this.userInfo) {
                if (_this.userInfo.memberId) {
                    _gioSetUserId = _this.userInfo.memberId;
                } else if (_this.userInfo.openId) {
                    _gioSetUserId = _this.userInfo.openId;
                } else {
                    _gioSetUserId = "";
                }
            }
            gio("init", "b665fa1721dac33b", {});
            // console.log(ddjhoc.userAction)
            // console.log(gio)
            // 给gio 传递用户信息
            gio("setUserId", _gioSetUserId);
            gio("send");
        },
        // 黑树科技 统计
        blackTree: function() {
            var _this = this;
            var _elqQ = _elqQ || [];
            _elqQ.push([ "elqSetSiteId", "980740743" ]);
            _elqQ.push([ "elqTrackPageView" ]);
            (function() {
                function async_load() {
                    var s = document.createElement("script");
                    s.type = "text/javascript";
                    s.async = true;
                    s.src = "//img07.en25.com/i/elqCfg.min.js";
                    // var x = document.getElementsByTagName('script')[0];
                    // x.parentNode.insertBefore(s, x);
                    oBody.append(s);
                }
                async_load();
            })();
            var elqCreateAccount = function(data) {
                try {
                    var memberid = data.memberId;
                    var emailAddress = memberid + "@dumy.com";
                    var source = data.source;
                    var xhr = new XMLHttpRequest();
                    xhr.open("post", "https://s980740743.t.eloqua.com/e/f2");
                    xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
                    xhr.send("elqFormName=无标题表单-1566901174675&elqSiteID=980740743&memberid1=" + memberid + "&source1=" + source + "&emailAddress=" + emailAddress + "&eloquaSync1=1" + "");
                    xhr.onreadystatechange = function() {};
                } catch (e) {
                    console.error("elqCreateAccount", e);
                }
                return true;
            };
            var _BTUserInfo = {
                memberId: "",
                source: ""
            };
            if (_this.userInfo) {
                if (_this.userInfo.memberId) {
                    _BTUserInfo.memberId = _this.userInfo.memberId;
                } else {
                    _BTUserInfo.memberId = "";
                }
            }
            // JudgeSource(ios, and, wxmin, wx, alipay, qq, h5)
            JudgeSource(function() {
                _BTUserInfo.source = "IOS_DDJAPP";
            }, function() {
                _BTUserInfo.source = "Android_DDJAPP";
            }, function() {
                _BTUserInfo.source = "WXMin";
            }, function() {
                _BTUserInfo.source = "WeiXinClient";
            }, function() {
                _BTUserInfo.source = "AlipayClient";
            }, function() {
                _BTUserInfo.source = "QQClient";
            }, function() {
                _BTUserInfo.source = "H5_BROWSER";
            });
            if (_BTUserInfo.memberId && _BTUserInfo.source) {
                // console.log('BT--数据齐全', _BTUserInfo)
                elqCreateAccount(_BTUserInfo);
            }
        }
    };
    // ZaneMa Testing
    $.getScript("/static_v4/js/plug/DDJStatistics.js", function(response, status) {
        ddjhoc.init(function() {
            TPLMethods.baidu();
            TPLMethods.gio();
            TPLMethods.blackTree();
        });
    });
});